From 2734b58bdd689848cc71c4bb8d638515519dfcbc Mon Sep 17 00:00:00 2001 From: Orange Date: Sat, 26 Apr 2025 00:32:53 +0300 Subject: [PATCH] fixed gimba lock for opengl camera --- source/engines/opengl_engine/formulas.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/engines/opengl_engine/formulas.cpp b/source/engines/opengl_engine/formulas.cpp index f3e5b5c..316ed11 100644 --- a/source/engines/opengl_engine/formulas.cpp +++ b/source/engines/opengl_engine/formulas.cpp @@ -32,9 +32,9 @@ namespace omath::opengl_engine } Mat4x4 RotationMatrix(const ViewAngles& angles) { - return MatRotationAxisZ(angles.roll) * + return MatRotationAxisX(-angles.pitch) * MatRotationAxisY(-angles.yaw) * - MatRotationAxisX(-angles.pitch); + MatRotationAxisZ(angles.roll); } Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near, const float far)