From d737454d32981282b1dd9de44ebd03a2d0a39f0d Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Sat, 7 Sep 2019 03:15:34 -0400 Subject: Added camera variable to render code --- src/render.cpp | 4 +++- src/render.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/render.cpp b/src/render.cpp index 7ae2fd7..ceef025 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -51,7 +51,7 @@ void RenderSystem::update([[maybe_unused]] entityx::EntityManager& entities, * SETUP * ***********/ - glm::mat4 view = glm::lookAt(glm::vec3(0.0f, 0.0f, 5.0f), // Pos + glm::mat4 view = glm::lookAt(camPos, // Pos glm::vec3(0.0f, 0.0f, 0.0f), // Facing glm::vec3(0.0f, 1.0f, 0.0f)); // Up @@ -260,6 +260,8 @@ int RenderSystem::init(void) //glPolygonOffset(1.0, 1.0); //glClearColor(0.6, 0.8, 1.0, 0.0); + + camPos = glm::vec3(0.0f, 0.0f, 0.5f); return 0; } diff --git a/src/render.hpp b/src/render.hpp index 5d3025c..0e4275e 100644 --- a/src/render.hpp +++ b/src/render.hpp @@ -45,6 +45,7 @@ private: SDL_GLContext context; Shader worldShader; + glm::vec3 camPos; public: RenderSystem(void) : -- cgit v1.2.3