Fixed Camera.SetPos modifying the gaze

Changed default camera position to a sane default
This commit is contained in:
Teo-CD 2019-11-03 18:03:30 +01:00
parent 37e525d6ee
commit 6209e91c28
3 changed files with 4 additions and 2 deletions

View file

@ -116,6 +116,8 @@ int main(int argc, char** argv)
glutTimerFunc(50,update_angle,0); 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 // Enters main loop, managed by GLUT
glutMainLoop(); glutMainLoop();

View file

@ -56,7 +56,7 @@ void Camera::look()
void Camera::set_position(const Vec3d& eye_pos) void Camera::set_position(const Vec3d& eye_pos)
{ {
gaze = eye_pos; eye = eye_pos;
} }
const Vec3d& Camera::get_eyepos() const const Vec3d& Camera::get_eyepos() const

View file

@ -17,7 +17,7 @@ namespace OGLE
/// Display function provided at setup. /// Display function provided at setup.
void (*custom_display)(); void (*custom_display)();
static double aspect_ratio; 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) void reshape(int new_x, int new_y)
{ {