#include "Entity.hpp"

#include "gl.hpp"

#include "Global.hpp"
#include "Game.hpp"
#include "ResourcesManager.hpp"


Entity::Entity(Game* g, Vector3f pos):
position(pos),
deleted(false),
m_Model(NULL),
game(g),
manager(g->getEntityManager())
{
}


void Entity::Render()
{
	glPushMatrix();
	glTranslatef(position.x,position.y,0);

	if(m_Model)
		m_Model->RenderModel();

	glPopMatrix();
}


void Entity::LoadModel(std::string Filename)
{
	m_Model=ResMan.GetModel(ResourceDir+Filename);
	cm=m_Model->CalculateCollisionBox();
}


void Entity::setPosition(Vector3f position)
{
	this->position = position;
}


void Entity::setCollisionModel(CollisionModel cm)
{
	this->cm = cm;
}
