Skip to content

Commit

Permalink
qgscamerapose: Do not restrict the pitch angle with qt6
Browse files Browse the repository at this point in the history
This was introduced as a workaround for a bug in Qt5. It has been
fixed in Qt6.
  • Loading branch information
ptitjano authored and nyalldawson committed Nov 25, 2022
1 parent c2bba3b commit ade4f0c
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/3d/qgscamerapose.cpp
Expand Up @@ -62,9 +62,13 @@ void QgsCameraPose::setPitchAngle( float pitch )
// prevent going over the head
// prevent bug in QgsCameraPose::updateCamera when updating camera rotation.
// With a mPitchAngle < 0.2 or > 179.8, QQuaternion::fromEulerAngles( mPitchAngle, mHeadingAngle, 0 )
// will return bad rotation angle.
// will return bad rotation angle in Qt5.
// See https://bugreports.qt.io/browse/QTBUG-72103
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
mPitchAngle = std::clamp( pitch, 0.2f, 179.8f );
#else
mPitchAngle = std::clamp( pitch, 0.0f, 180.0f );
#endif
}

void QgsCameraPose::updateCamera( Qt3DRender::QCamera *camera )
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ade4f0c

Please sign in to comment.