summaryrefslogtreecommitdiffstats
path: root/src/RendererEntity.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-27 04:10:36 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-27 04:10:36 +0100
commitc3472b8abd8185f392e6c2afb68a7411232396d6 (patch)
tree7b3544cdb5eccfcce2a1a7c8efaa5c09ae7455df /src/RendererEntity.cpp
parentRefactored GameState (diff)
downloadAltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.tar
AltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.tar.gz
AltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.tar.bz2
AltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.tar.lz
AltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.tar.xz
AltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.tar.zst
AltCraft-c3472b8abd8185f392e6c2afb68a7411232396d6.zip
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));