diff options
Diffstat (limited to 'src/gui/math3d/qquaternion.cpp')
-rw-r--r-- | src/gui/math3d/qquaternion.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp index edbe507e93d..b91215fdf4a 100644 --- a/src/gui/math3d/qquaternion.cpp +++ b/src/gui/math3d/qquaternion.cpp @@ -336,6 +336,9 @@ QVector3D QQuaternion::rotatedVector(const QVector3D &vector) const Extracts a 3D axis \a axis and a rotating angle \a angle (in degrees) that corresponds to this quaternion. + Both \a axis and \a angle must be valid, non-\nullptr pointers, + otherwise the behavior is undefined. + \sa fromAxisAndAngle() */ @@ -366,6 +369,9 @@ QQuaternion QQuaternion::fromAxisAndAngle(const QVector3D &axis, float angle) Extracts a 3D axis (\a x, \a y, \a z) and a rotating angle \a angle (in degrees) that corresponds to this quaternion. + All of \a x, \a y, \a z, and \a angle must be valid, non-\nullptr pointers, + otherwise the behavior is undefined. + \sa fromAxisAndAngle() */ void QQuaternion::getAxisAndAngle(float *x, float *y, float *z, float *angle) const @@ -421,19 +427,20 @@ QQuaternion QQuaternion::fromAxisAndAngle \since 5.5 Calculates roll, pitch, and yaw Euler angles (in degrees) - that corresponds to this quaternion. + that correspond to this quaternion. \sa fromEulerAngles() */ /*! - \fn QQuaternion QQuaternion::fromEulerAngles(const QVector3D &eulerAngles) + \fn QQuaternion QQuaternion::fromEulerAngles(const QVector3D &angles) \since 5.5 \overload - Creates a quaternion that corresponds to a rotation of \a eulerAngles: - eulerAngles.z() degrees around the z axis, eulerAngles.x() degrees around the x axis, - and eulerAngles.y() degrees around the y axis (in that order). + Creates a quaternion that corresponds to a rotation of \a angles: + angles.\l{QVector3D::}{z()} degrees around the z axis, + angles.\l{QVector3D::}{x()} degrees around the x axis, and + angles.\l{QVector3D::}{y()} degrees around the y axis (in that order). \sa toEulerAngles() */ @@ -446,6 +453,9 @@ QQuaternion QQuaternion::fromAxisAndAngle Calculates \a roll, \a pitch, and \a yaw Euler angles (in degrees) that corresponds to this quaternion. + All of \a pitch, \a yaw, and \a roll must be valid, non-\nullptr pointers, + otherwise the behavior is undefined. + \sa fromEulerAngles() */ void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll) const @@ -585,9 +595,9 @@ QMatrix3x3 QQuaternion::toRotationMatrix() const /*! \since 5.5 - Creates a quaternion that corresponds to a rotation matrix \a rot3x3. + Creates a quaternion that corresponds to the rotation matrix \a rot3x3. - \note If a given rotation matrix is not normalized, + \note If the given rotation matrix is not normalized, the resulting quaternion will contain scaling information. \sa toRotationMatrix(), fromAxes() @@ -634,6 +644,9 @@ QQuaternion QQuaternion::fromRotationMatrix(const QMatrix3x3 &rot3x3) Returns the 3 orthonormal axes (\a xAxis, \a yAxis, \a zAxis) defining the quaternion. + All of \a xAxis, \a yAxis, and \a zAxis must be valid, non-\nullptr pointers, + otherwise the behavior is undefined. + \sa fromAxes(), toRotationMatrix() */ void QQuaternion::getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const |