From 6209e91c2849dfb3294afa39fcd5a526b045c6ca Mon Sep 17 00:00:00 2001 From: Teo-CD Date: Sun, 3 Nov 2019 18:03:30 +0100 Subject: [PATCH] Fixed Camera.SetPos modifying the gaze Changed default camera position to a sane default --- example/main.cpp | 2 ++ src/Camera.cpp | 2 +- src/Engine.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/main.cpp b/example/main.cpp index a589260..2d150ce 100644 --- a/example/main.cpp +++ b/example/main.cpp @@ -116,6 +116,8 @@ int main(int argc, char** argv) glutTimerFunc(50,update_angle,0); + OGLE::camera.set_position({10,0,10}); + OGLE::camera.rotate({0,1.5*M_PI_4,0}); // Enters main loop, managed by GLUT glutMainLoop(); diff --git a/src/Camera.cpp b/src/Camera.cpp index ea51a3a..0b95c94 100644 --- a/src/Camera.cpp +++ b/src/Camera.cpp @@ -56,7 +56,7 @@ void Camera::look() void Camera::set_position(const Vec3d& eye_pos) { - gaze = eye_pos; + eye = eye_pos; } const Vec3d& Camera::get_eyepos() const diff --git a/src/Engine.h b/src/Engine.h index 39d9ab0..13c7d84 100644 --- a/src/Engine.h +++ b/src/Engine.h @@ -17,7 +17,7 @@ namespace OGLE /// Display function provided at setup. void (*custom_display)(); static double aspect_ratio; - static Camera camera({10,0,10},{-10,0,-10},{0,1,0}); + static Camera camera({0,0,0},{1,0,0},{0,1,0}); void reshape(int new_x, int new_y) {