fixed gimba lock for opengl camera

This commit is contained in:
2025-04-26 00:32:53 +03:00
parent d7f1f49165
commit 2734b58bdd

View File

@@ -32,9 +32,9 @@ namespace omath::opengl_engine
} }
Mat4x4 RotationMatrix(const ViewAngles& angles) Mat4x4 RotationMatrix(const ViewAngles& angles)
{ {
return MatRotationAxisZ<float, MatStoreType::COLUMN_MAJOR>(angles.roll) * return MatRotationAxisX<float, MatStoreType::COLUMN_MAJOR>(-angles.pitch) *
MatRotationAxisY<float, MatStoreType::COLUMN_MAJOR>(-angles.yaw) * MatRotationAxisY<float, MatStoreType::COLUMN_MAJOR>(-angles.yaw) *
MatRotationAxisX<float, MatStoreType::COLUMN_MAJOR>(-angles.pitch); MatRotationAxisZ<float, MatStoreType::COLUMN_MAJOR>(angles.roll);
} }
Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near, Mat4x4 CalcPerspectiveProjectionMatrix(const float fieldOfView, const float aspectRatio, const float near,
const float far) const float far)