Skip to content

Commit 713a5aa

Browse files
committed
GPU Display: Fix order in which Euler rotations are applied during animations
1 parent 7acc98d commit 713a5aa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎GPU/GPUTracking/display/helpers/GPUDisplayAnimation.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ int32_t GPUDisplay::animateCamera(bool suspended, float& animateTime, float& mix
179179
}
180180

181181
if (mCfgL.animationMode != 6) {
182-
if (mCfgL.animationMode & 1) // Rotation from euler angles
182+
if (mCfgL.animationMode & 1) // Rotation from euler angles, same order as setCamera (inverse of calcXYZ)
183183
{
184-
nextViewMatrix = nextViewMatrix * HMM_Rotate(-vals[4] * 180.f / CAMath::Pi(), {{1, 0, 0}}) * HMM_Rotate(vals[5] * 180.f / CAMath::Pi(), {{0, 1, 0}}) * HMM_Rotate(-vals[6] * 180.f / CAMath::Pi(), {{0, 0, 1}});
184+
nextViewMatrix = nextViewMatrix * HMM_Rotate(-vals[6] * 180.f / CAMath::Pi(), {{0, 0, 1}}) * HMM_Rotate(-vals[4] * 180.f / CAMath::Pi(), {{1, 0, 0}}) * HMM_Rotate(vals[5] * 180.f / CAMath::Pi(), {{0, 1, 0}});
185185
} else { // Rotation from quaternion
186186
const float mag = sqrtf(vals[4] * vals[4] + vals[5] * vals[5] + vals[6] * vals[6] + vals[7] * vals[7]);
187187
if (mag < 0.0001f) {

0 commit comments

Comments
 (0)