<commit_before>#include <iostream>

#include "WakeDefines.h"

#include "Logging/LogMacros.h"

#include "Engine/InputManager.h"
#include "Engine/GEngine.h"
#include "Engine/Bootstrap.h"
#include "Engine/Shader.h"

#include "World/World.h"
#include "World/StaticMeshComponent.h"
#include "World/CameraComponent.h"

#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/transform.hpp>

int xAxis = 0;
int yAxis = 0;

class CameraActor : public Actor
{
public:
	CameraActor(ActorID Id, bool StartActive)
		: Actor(Id, StartActive)
	{
	}

	virtual void Spawn() override
	{
		Actor::Spawn();

		Camera = CreateComponent<CameraComponent>(true);
	}

private:
	CameraComponent* Camera;
};

class TestActor : public Actor
{
public:
	TestActor(ActorID Id, bool StartActive)
		: Actor(Id, StartActive)
	{
	}

	virtual void Spawn() override
	{
		Actor::Spawn();

		ShaderProgram* Shader = new ShaderProgram(ShaderProgram::LoadProgram("assets/shaders/basic.vert", "assets/shaders/basic.frag"));
		GLint posAttrib = glGetAttribLocation(Shader->GetProgram(), "position");

		float vertices[] = {
			0.f, 0.5f, 0.f,
			0.5f, -0.5f, 0.f,
			-0.5f, -0.5f, 0.f
		};

		GLuint vbo;
		GLuint vao;

		glGenBuffers(1, &vbo);
		glBindBuffer(GL_ARRAY_BUFFER, vbo);

		glGenVertexArrays(1, &vao);
		glBindVertexArray(vao);

		glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
		glVertexAttribPointer(posAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
		glEnableVertexAttribArray(posAttrib);

		MeshComponent = CreateComponent<StaticMeshComponent>(true, new StaticMesh(vbo, vao, 3), Shader);
	}

	virtual void Tick() override
	{
		Actor::Tick();

		SetRotation(GetRotation() * glm::quat(glm::vec3(0, glm::pi<float>() / 2.f, 0) * W_ENGINE.GetDeltaTime()));
	}

private:
	StaticMeshComponent* MeshComponent;
};

void Left(const Input& Input)
{
	xAxis += Input.Mode == EInputMode::Pressed ? -1 : 1;
}

void Right(const Input& Input)
{
	xAxis += Input.Mode == EInputMode::Pressed ? 1 : -1;
}

void Up(const Input& Input)
{
	yAxis += Input.Mode == EInputMode::Pressed ? 1 : -1;
}

void Down(const Input& Input)
{
	yAxis += Input.Mode == EInputMode::Pressed ? -1 : 1;
}

void OnInput_Exit(const Input& Input)
{
	W_ENGINE.Stop();
}

CameraActor* Cam = nullptr;

void Tick()
{
	auto fwd = Cam->GetForward();
	auto right = Cam->GetRight();
	Cam->SetPosition(Cam->GetPosition() + (Cam->GetForward() * (float)yAxis + Cam->GetRight() * (float)xAxis) * W_ENGINE.GetDeltaTime());

	auto MousePos = sf::Mouse::getPosition(*W_ENGINE.GetGameWindow().GetRenderWindow());
	auto Center = sf::Vector2i(W_ENGINE.GetGameWindow().GetWidth() / 2, W_ENGINE.GetGameWindow().GetHeight() / 2);
	float xChange = Center.x - MousePos.x;
	float yChange = Center.y - MousePos.y;
	auto rot = glm::vec3(yChange, xChange, 0) * W_ENGINE.GetDeltaTime();
	Cam->SetRotation(Cam->GetRotation() * glm::quat(rot));
	sf::Mouse::setPosition(Center, *W_ENGINE.GetGameWindow().GetRenderWindow());
}

void Setup()
{
	Actor* Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(-1, 0, -1));
	Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(-1, 0, 1));
	Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(1, 0, -1));
	Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(1, 0, 1));
	Test->SetRotation(glm::quat(glm::vec3(0, glm::pi<float>() / 2.f, 0)));

	Cam = W_WORLD.SpawnActor<CameraActor>(true);
	Cam->SetPosition(glm::vec3(0, 0, 3));

	W_INPUT.Bind("Exit", INPUT_BIND(Keyboard, Pressed, Escape));
	W_INPUT.Event("Exit").Bind(&OnInput_Exit);
<commit_msg>trying random shit at this point<commit_after>#include <iostream>

#include "WakeDefines.h"

#include "Logging/LogMacros.h"

#include "Engine/InputManager.h"
#include "Engine/GEngine.h"
#include "Engine/Bootstrap.h"
#include "Engine/Shader.h"

#include "World/World.h"
#include "World/StaticMeshComponent.h"
#include "World/CameraComponent.h"

#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/transform.hpp>

int xAxis = 0;
int yAxis = 0;

class CameraActor : public Actor
{
public:
	CameraActor(ActorID Id, bool StartActive)
		: Actor(Id, StartActive)
	{
	}

	virtual void Spawn() override
	{
		Actor::Spawn();

		Camera = CreateComponent<CameraComponent>(true);
	}

private:
	CameraComponent* Camera;
};

class TestActor : public Actor
{
public:
	TestActor(ActorID Id, bool StartActive)
		: Actor(Id, StartActive)
	{
	}

	virtual void Spawn() override
	{
		Actor::Spawn();

		ShaderProgram* Shader = new ShaderProgram(ShaderProgram::LoadProgram("assets/shaders/basic.vert", "assets/shaders/basic.frag"));
		GLint posAttrib = glGetAttribLocation(Shader->GetProgram(), "position");

		float vertices[] = {
			0.f, 0.5f, 0.f,
			0.5f, -0.5f, 0.f,
			-0.5f, -0.5f, 0.f
		};

		GLuint vbo;
		GLuint vao;

		glGenBuffers(1, &vbo);
		glBindBuffer(GL_ARRAY_BUFFER, vbo);

		glGenVertexArrays(1, &vao);
		glBindVertexArray(vao);

		glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
		glVertexAttribPointer(posAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0);
		glEnableVertexAttribArray(posAttrib);

		MeshComponent = CreateComponent<StaticMeshComponent>(true, new StaticMesh(vbo, vao, 3), Shader);
	}

	virtual void Tick() override
	{
		Actor::Tick();

		SetRotation(GetRotation() * glm::quat(glm::vec3(0, glm::pi<float>() / 2.f, 0) * W_ENGINE.GetDeltaTime()));
	}

private:
	StaticMeshComponent* MeshComponent;
};

void Left(const Input& Input)
{
	xAxis += Input.Mode == EInputMode::Pressed ? -1 : 1;
}

void Right(const Input& Input)
{
	xAxis += Input.Mode == EInputMode::Pressed ? 1 : -1;
}

void Up(const Input& Input)
{
	yAxis += Input.Mode == EInputMode::Pressed ? 1 : -1;
}

void Down(const Input& Input)
{
	yAxis += Input.Mode == EInputMode::Pressed ? -1 : 1;
}

void OnInput_Exit(const Input& Input)
{
	W_ENGINE.Stop();
}

CameraActor* Cam = nullptr;

void Tick()
{
	auto fwd = Cam->GetForward();
	auto right = Cam->GetRight();
	Cam->SetPosition(Cam->GetPosition() + (Cam->GetForward() * (float)yAxis + Cam->GetRight() * (float)xAxis) * W_ENGINE.GetDeltaTime());

	auto MousePos = sf::Mouse::getPosition(*W_ENGINE.GetGameWindow().GetRenderWindow());
	auto Center = sf::Vector2i(W_ENGINE.GetGameWindow().GetWidth() / 2, W_ENGINE.GetGameWindow().GetHeight() / 2);
	float xChange = glm::clamp(Center.x - MousePos.x, -5, 5) * W_ENGINE.GetDeltaTime();
	float yChange = glm::clamp(Center.y - MousePos.y, -5, 5) * W_ENGINE.GetDeltaTime();
	auto Pitch = glm::angleAxis(yChange, Cam->GetRight());
	auto Yaw = glm::angleAxis(xChange, Cam->GetUp());
	Cam->SetRotation(Pitch * Yaw * Cam->GetRotation());

	sf::Mouse::setPosition(Center, *W_ENGINE.GetGameWindow().GetRenderWindow());
}

void Setup()
{
	Actor* Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(-1, 0, -1));
	Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(-1, 0, 1));
	Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(1, 0, -1));
	Test = W_WORLD.SpawnActor<TestActor>();
	Test->SetPosition(glm::vec3(1, 0, 1));
	Test->SetRotation(glm::quat(glm::vec3(0, glm::pi<float>() / 2.f, 0)));

	Cam = W_WORLD.SpawnActor<CameraActor>(true);
	Cam->SetPosition(glm::vec3(0, 0, 3));

	W_INPUT.Bind("Exit", INPUT_BIND(Keyboard, Pressed, Escape));
	W_INPUT.Event("Exit").Bind(&OnInput_Exit);

{'fraction_non_alphanumeric': 0.17487011211375444, 'fraction_numerical': 0.017500683620453924, 'mean_word_length': 5.289767841788478, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 1, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1148294', 'n_tokens_mistral': 2988, 'n_tokens_neox': 2834, 'n_words': 522}