From 10f7963fae47f4195048dc5519235dafdbe5e498 Mon Sep 17 00:00:00 2001 From: trotFunky Date: Mon, 4 Nov 2019 15:30:59 +0100 Subject: [PATCH] Fixed rotation angle about y-axis not being halved for quaternion rotation --- src/Camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Camera.cpp b/src/Camera.cpp index 0b95c94..7c0aa16 100644 --- a/src/Camera.cpp +++ b/src/Camera.cpp @@ -39,7 +39,7 @@ void Camera::rotate(const Vec3d& rotation) gaze = z_rotation * gaze; gaze_up = z_rotation * gaze_up; - Quaternion y_rotation{0,sin(rotation.y),0,cos(rotation.y)}; + Quaternion y_rotation{0,sin(rotation.y/2),0,cos(rotation.y/2)}; y_rotation.normalize(); gaze = y_rotation * gaze; gaze_up = y_rotation * gaze_up;