#pragma once

#include <glm/glm.hpp>

#include <InputComponent.h>
#include <GraphicsComponent.h>
#include <PhysicsComponent.h>

class GameObject
{
public:
	glm::vec3 Position;

	glm::vec3 Rotation;

	glm::vec3 Scale;

	GameObject(glm::vec3 Position, glm::vec3 Rotation, glm::vec3 Scale)
		: Input(nullptr),
		Graphics(nullptr),
		Physics(nullptr),
		Position(Position),
		Rotation(Rotation),
		Scale(Scale),
		Front(0.0f, 0.0f, 1.0f),
		Up(0.0f, 1.0f, 0.0f),
		Right(1.0f, 0.0f, 0.0f),
		WorldUp(0.0f, 1.0f, 0.0f)
	{
	}
	
	GameObject(InputComponent* Input, GraphicsComponent* Graphics, PhysicsComponent* Physics)
	:	Input(Input),
		Graphics(Graphics),
		Physics(Physics),
		Position(0.0f, 0.0f, 0.0f),
		Rotation(0.0f, 0.0f, 0.0f),
		Scale(1.0f, 1.0f, 1.0f),
		Front(0.0f, 0.0f, 1.0f),
		Up(0.0f, 1.0f, 0.0f),
		Right(1.0f, 0.0f, 0.0f),
		WorldUp(0.0f, 1.0f, 0.0f)
	{}

	void Update()
	{
		Input->Update();
		Graphics->Update();
		Physics->Update();
	}

protected:
	InputComponent* Input;
	GraphicsComponent* Graphics;
	PhysicsComponent* Physics;

	glm::vec3 Front;
	glm::vec3 Up;
	glm::vec3 Right;
	glm::vec3 WorldUp;
};