Skip to content

Commit

Permalink
Fix 3d camera yaw and pitch sensitivity
Browse files Browse the repository at this point in the history
(cherry picked from commit 48c3f28)
  • Loading branch information
uclaros authored and nyalldawson committed Jan 15, 2021
1 parent 0a9f20f commit f3413ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/3d/qgscameracontroller.cpp
Expand Up @@ -296,8 +296,8 @@ void QgsCameraController::onPositionChanged( Qt3DInput::QMouseEvent *mouse )
// rotate/tilt using mouse (camera moves as it rotates around its view center)
float pitch = mCameraPose.pitchAngle();
float yaw = mCameraPose.headingAngle();
pitch += dy;
yaw -= dx / 2;
pitch += 0.2f * dy;
yaw -= 0.2f * dx;
mCameraPose.setPitchAngle( pitch );
mCameraPose.setHeadingAngle( yaw );
updateCameraFromPose();
Expand All @@ -306,7 +306,7 @@ void QgsCameraController::onPositionChanged( Qt3DInput::QMouseEvent *mouse )
{
// rotate/tilt using mouse (camera stays at one position as it rotates)
float diffPitch = 0.2f * dy;
float diffYaw = 0.2f * -dx / 2;
float diffYaw = - 0.2f * dx;
rotateCamera( diffPitch, diffYaw );
updateCameraFromPose( true );
}
Expand Down

0 comments on commit f3413ac

Please sign in to comment.