From 3e29e6db2822814258b137c1f71923b3507dacbc Mon Sep 17 00:00:00 2001 From: Michael Hitchens Date: Mon, 15 Apr 2024 17:12:51 -0400 Subject: [PATCH] Update mViewProjectionMatrix after modiying mViewMatrix I added an ArcballCamera to #428 and noticed that it wasn't working as expected. ArcballCamera wasn't updating mViewProjectionMatrix after modifying mViewMatrix. This was causing the ArcballCamera to not work correctly when combined with the classes introduced in #426. --- src/ppx/camera.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ppx/camera.cpp b/src/ppx/camera.cpp index e3b601b63..7b348aa2b 100644 --- a/src/ppx/camera.cpp +++ b/src/ppx/camera.cpp @@ -301,6 +301,7 @@ void ArcballCamera::UpdateCamera() { mViewMatrix = mTranslationMatrix * glm::mat4_cast(mRotationQuat) * mCenterTranslationMatrix; mInverseViewMatrix = glm::inverse(mViewMatrix); + mViewProjectionMatrix = mProjectionMatrix * mViewMatrix; // Transform the view space origin into world space for eye position mEyePosition = mInverseViewMatrix * float4(0, 0, 0, 1);