Skip to content
Permalink
Browse files

Fix 3d camera yaw and pitch sensitivity

  • Loading branch information
uclaros authored and nyalldawson committed Dec 22, 2020
1 parent a6be112 commit 48c3f280c9b74dddf86269a163bfef48f92ae542
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/3d/qgscameracontroller.cpp
@@ -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();
@@ -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 );
}

0 comments on commit 48c3f28

Please sign in to comment.
You can’t perform that action at this time.