Skip to content

Commit

Permalink
Update mViewProjectionMatrix after modiying mViewMatrix
Browse files Browse the repository at this point in the history
I added an ArcballCamera to google#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 google#426.
  • Loading branch information
footballhead committed Apr 15, 2024
1 parent 3f7db97 commit 3e29e6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ppx/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3e29e6d

Please sign in to comment.