From db66ceacd1768c6b75762a157afd0a162dc1d2a4 Mon Sep 17 00:00:00 2001 From: Ben Kyd Date: Wed, 31 Jul 2019 06:54:13 +0100 Subject: [PATCH] Fixed that weird bug, some weird edge case with initializer lists and GLM --- src/definitions/camera.cpp | 1 + src/definitions/camera.hpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/definitions/camera.cpp b/src/definitions/camera.cpp index 8c36f39..5d3793f 100644 --- a/src/definitions/camera.cpp +++ b/src/definitions/camera.cpp @@ -1,6 +1,7 @@ #include "camera.hpp" Camera::Camera(glm::vec3 point, glm::vec3 dir, float w, float h, float f) { + point = { 0.0f, 0.0f, 0.0f }; point = point; direction = dir; w = w; h = h; focalLen = f; diff --git a/src/definitions/camera.hpp b/src/definitions/camera.hpp index 05981c0..834ced4 100644 --- a/src/definitions/camera.hpp +++ b/src/definitions/camera.hpp @@ -9,11 +9,11 @@ public: void Update(); - glm::vec3 point; - glm::vec3 direction; - glm::vec3 planeCenter; - glm::vec3 planeDirX; - glm::vec3 planeDirY; + glm::vec3 point = {}; + glm::vec3 direction = {}; + glm::vec3 planeCenter = {}; + glm::vec3 planeDirX = {}; + glm::vec3 planeDirY = {}; float focalLen, w, h; };