summaryrefslogtreecommitdiffstats
path: root/src/RendererEntity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/RendererEntity.cpp')
-rw-r--r--src/RendererEntity.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/RendererEntity.cpp b/src/RendererEntity.cpp
index a1c9566..fef7dbd 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,9 +115,8 @@ GLuint RendererEntity::GetVao(){
return Vao;
}
-RendererEntity::RendererEntity(World *ptr, unsigned int id)
+RendererEntity::RendererEntity(unsigned int id)
{
- world = ptr;
entityId = id;
}
@@ -125,7 +125,7 @@ RendererEntity::~RendererEntity() {
void RendererEntity::Render(RenderState & renderState) {
glm::mat4 model = glm::mat4(1.0);
- Entity& entity = world->GetEntity(entityId);
+ Entity entity = GlobalState::GetGameState()->GetWorld().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));