From 4686f94082851bc2a81c6935edec07f14f1c6d3b Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sat, 15 Nov 2014 14:55:11 +0100 Subject: [PATCH] Changing code to work with getCamera using pointers now. --- graphics.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics.cc b/graphics.cc index 651fe00..99a0ae7 100644 --- a/graphics.cc +++ b/graphics.cc @@ -161,10 +161,10 @@ glm::mat4 Graphics::buildFrustum( float phiInDegree, float _near, float _far, fl } glm::mat4 Graphics::buildViewMatrix(Level* level) { - glm::vec4 cameraVector = glm::vec4(0.0f, 0.0f, level->getCamera().getDistance(), 0.0f); + glm::vec4 cameraVector = glm::vec4(0.0f, 0.0f, level->getCamera()->getDistance(), 0.0f); // rotate vector glm::mat4 rotationMatrix = - glm::rotate(level->getCamera().getRotation()[1], glm::vec3(0.0f, 1.0f, 0.0f)) *glm::rotate(level->getCamera().getRotation()[0], glm::vec3(1.0f, 0.0f, 0.0f)); + glm::rotate(level->getCamera()->getRotation()[1], glm::vec3(0.0f, 1.0f, 0.0f)) *glm::rotate(level->getCamera()->getRotation()[0], glm::vec3(1.0f, 0.0f, 0.0f)); cameraVector = rotationMatrix * cameraVector; //construct lookAt (cameraPosition = cameraCenter + cameraVector return glm::lookAt(level->getCameraCenter()->getPosition() + glm::vec3(cameraVector), level->getCameraCenter()->getPosition(), glm::vec3(0.0f, 1.0f, 0.0f));