Skip to content

Commit

Permalink
Make elevation changes less sensitive vs ground movements changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 14, 2021
1 parent 7fa38ce commit 48036b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/3d/qgscameracontroller.cpp
Expand Up @@ -596,16 +596,19 @@ void QgsCameraController::onKeyPressedFlyNavigation()
cameraPosDiff += - mCameraMovementSpeed * cameraFront;
}

// note -- vertical axis movements are slower by default then horizontal ones, as GIS projects
// tend to have much more limited elevation range vs ground range
static constexpr double ELEVATION_MOVEMENT_SCALE = 0.5;
if ( mDepressedKeys.contains( Qt::Key_PageUp ) || mDepressedKeys.contains( Qt::Key_E ) )
{
changed = true;
cameraPosDiff += mCameraMovementSpeed * QVector3D( 0.0f, 1.0f, 0.0f );
cameraPosDiff += ELEVATION_MOVEMENT_SCALE * mCameraMovementSpeed * QVector3D( 0.0f, 1.0f, 0.0f );
}

if ( mDepressedKeys.contains( Qt::Key_PageDown ) || mDepressedKeys.contains( Qt::Key_Q ) )
{
changed = true;
cameraPosDiff += - mCameraMovementSpeed * QVector3D( 0.0f, 1.0f, 0.0f );
cameraPosDiff += ELEVATION_MOVEMENT_SCALE * - mCameraMovementSpeed * QVector3D( 0.0f, 1.0f, 0.0f );
}

if ( changed )
Expand Down

0 comments on commit 48036b7

Please sign in to comment.