Skip to content

Commit

Permalink
Fix 3d camera yaw and pitch sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Dec 22, 2020
1 parent a6be112 commit 48c3f28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/3d/qgscameracontroller.cpp
Expand Up @@ -305,8 +305,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 @@ -315,7 +315,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 48c3f28

Please sign in to comment.