qgscamerapose: Do not restrict the pitch angle with qt6

This was introduced as a workaround for a bug in Qt5. It has been
fixed in Qt6.
This commit is contained in:
Jean Felder 2022-09-01 22:37:21 +02:00 committed by Nyall Dawson
parent c2bba3b840
commit ade4f0cf0f
11 changed files with 5 additions and 1 deletions

View File

@ -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 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB