diff options
Diffstat (limited to 'src/RendererEntity.cpp')
-rw-r--r-- | src/RendererEntity.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/RendererEntity.cpp b/src/RendererEntity.cpp index a1c9566..25403be 100644 --- a/src/RendererEntity.cpp +++ b/src/RendererEntity.cpp @@ -4,9 +4,10 @@ #include <glm/gtc/type_ptr.hpp> #include "Entity.hpp" -#include "World.hpp" +#include "GameState.hpp" #include "Renderer.hpp" #include "AssetManager.hpp" +#include "GlobalState.hpp" const GLfloat vertices[] = { -0.5f, 0.5f, 0.5f, @@ -114,18 +115,17 @@ GLuint RendererEntity::GetVao(){ return Vao; } -RendererEntity::RendererEntity(World *ptr, unsigned int id) +RendererEntity::RendererEntity(unsigned int id) { - world = ptr; entityId = id; } RendererEntity::~RendererEntity() { } -void RendererEntity::Render(RenderState & renderState) { +void RendererEntity::Render(RenderState& renderState, const World *world) { glm::mat4 model = glm::mat4(1.0); - Entity& entity = world->GetEntity(entityId); + const Entity &entity = world->GetEntity(entityId); model = glm::translate(model, entity.pos.glm()); model = glm::translate(model, glm::vec3(0, entity.height / 2.0, 0)); model = glm::scale(model, glm::vec3(entity.width, entity.height, entity.width)); |