![]() |
Qt 6.x
The Qt SDK
|
The QQuaternion class represents a quaternion consisting of a vector and scalar. More...
#include <qquaternion.h>
Public Member Functions | |
QQuaternion () | |
Constructs an identity quaternion (1, 0, 0, 0), i.e. | |
QQuaternion (Qt::Initialization) | |
QQuaternion (float scalar, float xpos, float ypos, float zpos) | |
Constructs a quaternion with the vector (xpos, ypos, zpos) and scalar. | |
QQuaternion (float scalar, const QVector3D &vector) | |
Constructs a quaternion vector from the specified vector and scalar. | |
QQuaternion (const QVector4D &vector) | |
Constructs a quaternion from the components of vector. | |
bool | isNull () const |
Returns true if the x, y, z, and scalar components of this quaternion are set to 0.0; otherwise returns false . | |
bool | isIdentity () const |
Returns true if the x, y, and z components of this quaternion are set to 0.0, and the scalar component is set to 1.0; otherwise returns false . | |
QVector3D | vector () const |
Returns the vector component of this quaternion. | |
void | setVector (const QVector3D &vector) |
Sets the vector component of this quaternion to vector. | |
void | setVector (float x, float y, float z) |
Sets the vector component of this quaternion to (x, y, z). | |
float | x () const |
Returns the x coordinate of this quaternion's vector. | |
float | y () const |
Returns the y coordinate of this quaternion's vector. | |
float | z () const |
Returns the z coordinate of this quaternion's vector. | |
float | scalar () const |
Returns the scalar component of this quaternion. | |
void | setX (float x) |
Sets the x coordinate of this quaternion's vector to the given x coordinate. | |
void | setY (float y) |
Sets the y coordinate of this quaternion's vector to the given y coordinate. | |
void | setZ (float z) |
Sets the z coordinate of this quaternion's vector to the given z coordinate. | |
void | setScalar (float scalar) |
Sets the scalar component of this quaternion to scalar. | |
float | length () const |
Returns the length of the quaternion. | |
float | lengthSquared () const |
Returns the squared length of the quaternion. | |
QQuaternion | normalized () const |
Returns the normalized unit form of this quaternion. | |
void | normalize () |
Normalizes the current quaternion in place. | |
QQuaternion | inverted () const |
QQuaternion | conjugated () const |
QVector3D | rotatedVector (const QVector3D &vector) const |
Rotates vector with this quaternion to produce a new vector in 3D space. | |
QQuaternion & | operator+= (const QQuaternion &quaternion) |
Adds the given quaternion to this quaternion and returns a reference to this quaternion. | |
QQuaternion & | operator-= (const QQuaternion &quaternion) |
Subtracts the given quaternion from this quaternion and returns a reference to this quaternion. | |
QQuaternion & | operator*= (float factor) |
Multiplies this quaternion's components by the given factor, and returns a reference to this quaternion. | |
QQuaternion & | operator*= (const QQuaternion &quaternion) |
Multiplies this quaternion by quaternion and returns a reference to this quaternion. | |
QQuaternion & | operator/= (float divisor) |
Divides this quaternion's components by the given divisor, and returns a reference to this quaternion. | |
QVector4D | toVector4D () const |
Returns this quaternion as a 4D vector. | |
operator QVariant () const | |
Returns the quaternion as a QVariant. | |
void | getAxisAndAngle (QVector3D *axis, float *angle) const |
void | getAxisAndAngle (float *x, float *y, float *z, float *angle) const |
QVector3D | toEulerAngles () const |
void | getEulerAngles (float *pitch, float *yaw, float *roll) const |
QMatrix3x3 | toRotationMatrix () const |
void | getAxes (QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const |
Static Public Member Functions | |
static constexpr float | dotProduct (const QQuaternion &q1, const QQuaternion &q2) |
static QQuaternion | fromAxisAndAngle (const QVector3D &axis, float angle) |
Creates a normalized quaternion that corresponds to rotating through angle degrees about the specified 3D axis. | |
static QQuaternion | fromAxisAndAngle (float x, float y, float z, float angle) |
Creates a normalized quaternion that corresponds to rotating through angle degrees about the 3D axis (x, y, z). | |
static QQuaternion | fromEulerAngles (const QVector3D &eulerAngles) |
static QQuaternion | fromEulerAngles (float pitch, float yaw, float roll) |
static QQuaternion | fromRotationMatrix (const QMatrix3x3 &rot3x3) |
static QQuaternion | fromAxes (const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis) |
static QQuaternion | fromDirection (const QVector3D &direction, const QVector3D &up) |
static QQuaternion | rotationTo (const QVector3D &from, const QVector3D &to) |
static QQuaternion | slerp (const QQuaternion &q1, const QQuaternion &q2, float t) |
Interpolates along the shortest spherical path between the rotational positions q1 and q2. | |
static QQuaternion | nlerp (const QQuaternion &q1, const QQuaternion &q2, float t) |
Interpolates along the shortest linear path between the rotational positions q1 and q2. | |
Friends | |
QT_WARNING_PUSH QT_WARNING_DISABLE_FLOAT_COMPARE friend bool | operator== (const QQuaternion &q1, const QQuaternion &q2) noexcept |
Returns true if q1 is equal to q2; otherwise returns false . | |
bool | operator!= (const QQuaternion &q1, const QQuaternion &q2) noexcept |
Returns true if q1 is not equal to q2; otherwise returns false . | |
QT_WARNING_POP friend const QQuaternion | operator+ (const QQuaternion &q1, const QQuaternion &q2) |
Returns a QQuaternion object that is the sum of the given quaternions, q1 and q2; each component is added separately. | |
const QQuaternion | operator- (const QQuaternion &q1, const QQuaternion &q2) |
Returns a QQuaternion object that is formed by subtracting q2 from q1; each component is subtracted separately. | |
const QQuaternion | operator* (float factor, const QQuaternion &quaternion) |
Returns a copy of the given quaternion, multiplied by the given factor. | |
const QQuaternion | operator* (const QQuaternion &quaternion, float factor) |
Returns a copy of the given quaternion, multiplied by the given factor. | |
const QQuaternion | operator* (const QQuaternion &q1, const QQuaternion &q2) |
Multiplies q1 and q2 using quaternion multiplication. | |
const QQuaternion | operator- (const QQuaternion &quaternion) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QQuaternion object that is formed by changing the sign of all three components of the given quaternion. | |
const QQuaternion | operator/ (const QQuaternion &quaternion, float divisor) |
Returns the QQuaternion object formed by dividing all components of the given quaternion by the given divisor. | |
bool | qFuzzyCompare (const QQuaternion &q1, const QQuaternion &q2) |
Returns true if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise. | |
Related Symbols | |
(Note that these are not member symbols.) | |
const QQuaternion | operator+ (const QQuaternion &q1, const QQuaternion &q2) |
Returns a QQuaternion object that is the sum of the given quaternions, q1 and q2; each component is added separately. | |
const QQuaternion | operator- (const QQuaternion &q1, const QQuaternion &q2) |
Returns a QQuaternion object that is formed by subtracting q2 from q1; each component is subtracted separately. | |
const QQuaternion | operator* (float factor, const QQuaternion &quaternion) |
Returns a copy of the given quaternion, multiplied by the given factor. | |
const QQuaternion | operator* (const QQuaternion &quaternion, float factor) |
Returns a copy of the given quaternion, multiplied by the given factor. | |
const QQuaternion | operator* (const QQuaternion &q1, const QQuaternion &q2) |
Multiplies q1 and q2 using quaternion multiplication. | |
const QQuaternion | operator- (const QQuaternion &quaternion) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QQuaternion object that is formed by changing the sign of all three components of the given quaternion. | |
const QQuaternion | operator/ (const QQuaternion &quaternion, float divisor) |
Returns the QQuaternion object formed by dividing all components of the given quaternion by the given divisor. | |
QVector3D | operator* (const QQuaternion &quaternion, const QVector3D &vec) |
bool | qFuzzyCompare (const QQuaternion &q1, const QQuaternion &q2) |
Returns true if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise. | |
QDataStream & | operator<< (QDataStream &stream, const QQuaternion &quaternion) |
Writes the given quaternion to the given stream and returns a reference to the stream. | |
QDataStream & | operator>> (QDataStream &stream, QQuaternion &quaternion) |
Reads a quaternion from the given stream into the given quaternion and returns a reference to the stream. | |
The QQuaternion class represents a quaternion consisting of a vector and scalar.
\inmodule QtGui
Quaternions are used to represent rotations in 3D space, and consist of a 3D rotation axis specified by the x, y, and z coordinates, and a scalar representing the rotation angle.
Definition at line 20 of file qquaternion.h.
|
inline |
Constructs an identity quaternion (1, 0, 0, 0), i.e.
with the vector (0, 0, 0) and scalar 1.
Definition at line 138 of file qquaternion.h.
Referenced by conjugated(), fromAxisAndAngle(), fromAxisAndAngle(), fromDirection(), fromEulerAngles(), fromRotationMatrix(), inverted(), normalized(), rotatedVector(), and rotationTo().
|
inlineexplicit |
Constructs a quaternion without initializing the contents.
Definition at line 24 of file qquaternion.h.
|
inline |
Constructs a quaternion with the vector (xpos, ypos, zpos) and scalar.
Definition at line 140 of file qquaternion.h.
|
inline |
Constructs a quaternion vector from the specified vector and scalar.
Definition at line 287 of file qquaternion.h.
|
inlineexplicit |
Constructs a quaternion from the components of vector.
Definition at line 337 of file qquaternion.h.
|
inline |
Returns the conjugate of this quaternion, which is (-x, -y, -z, scalar).
Definition at line 184 of file qquaternion.h.
References QQuaternion().
Referenced by QQuickQuaternionValueType::conjugated(), rotatedVector(), and src_gui_math3d_qquaternion::wrapper1().
|
inlinestaticconstexpr |
Returns the dot product of q1 and q2.
Definition at line 166 of file qquaternion.h.
Referenced by QQuickQuaternionValueType::dotProduct(), nlerp(), and slerp().
|
static |
Constructs the quaternion using 3 axes (xAxis, yAxis, zAxis).
Definition at line 660 of file qquaternion.cpp.
References fromRotationMatrix(), Qt::Uninitialized, QVector3D::x(), QVector3D::y(), and QVector3D::z().
Referenced by fromDirection().
|
static |
Creates a normalized quaternion that corresponds to rotating through angle degrees about the specified 3D axis.
Definition at line 348 of file qquaternion.cpp.
References QQuaternion(), QVector3D::normalized(), qDegreesToRadians(), QVector3D::x(), QVector3D::y(), and QVector3D::z().
Referenced by QQuick3DQuaternionUtils::fromAxesAndAngles(), QQuick3DQuaternionUtils::fromAxesAndAngles(), QQuick3DQuaternionUtils::fromAxisAndAngle(), QQuick3DQuaternionUtils::fromAxisAndAngle(), QQuick3DQuaternionUtils::lookAt(), QQuick3DNode::rotate(), and rotationQuaternionForLookAt().
|
static |
Creates a normalized quaternion that corresponds to rotating through angle degrees about the 3D axis (x, y, z).
Definition at line 402 of file qquaternion.cpp.
References QQuaternion(), length(), qDegreesToRadians(), qFuzzyCompare, qFuzzyIsNull(), and qHypot().
|
static |
Constructs the quaternion using specified forward direction direction and upward direction up. If the upward direction was not specified or the forward and upward vectors are collinear, a new orthonormal upward direction will be generated.
Definition at line 686 of file qquaternion.cpp.
References QQuaternion(), QVector3D::crossProduct(), direction, fromAxes(), QVector3D::lengthSquared(), QVector3D::normalize(), qFuzzyIsNull(), and rotationTo().
Referenced by setupCameraForShadowMap().
|
inlinestatic |
Creates a quaternion that corresponds to a rotation of 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).
Definition at line 321 of file qquaternion.h.
References fromEulerAngles(), QVector3D::x(), QVector3D::y(), and QVector3D::z().
Referenced by calculate(), QPhysicsCommandReset::execute(), fromEulerAngles(), QQuick3DQuaternionUtils::fromEulerAngles(), QQuick3DQuaternionUtils::fromEulerAngles(), RotationData::getQuaternionRotation(), QQuick3DQuaternionAnimation::setFromXRotation(), QQuick3DQuaternionAnimation::setFromYRotation(), QQuick3DQuaternionAnimation::setFromZRotation(), QSSGRenderLayer::setProbeOrientation(), QQuick3DQuaternionAnimation::setToXRotation(), QQuick3DQuaternionAnimation::setToYRotation(), QQuick3DQuaternionAnimation::setToZRotation(), setupCubeReflectionCameras(), and setupCubeShadowCameras().
|
static |
Creates a quaternion that corresponds to a rotation of roll degrees around the z axis, pitch degrees around the x axis, and yaw degrees around the y axis (in that order).
Definition at line 513 of file qquaternion.cpp.
References QQuaternion(), c2, qDegreesToRadians(), s2, and s3.
|
static |
Creates a quaternion that corresponds to a rotation matrix rot3x3.
Definition at line 596 of file qquaternion.cpp.
References QQuaternion(), i, j, and scalar().
Referenced by QQuick3DNodePrivate::emitChangesToSceneTransform(), fromAxes(), getPhysXWorldTransform(), QQuick3DInstancing::InstanceTableEntry::getRotation(), QQuick3DNode::rotate(), QQuick3DNode::sceneRotation(), and QQuick3DNode::updateSpatialNode().
Returns the 3 orthonormal axes (xAxis, yAxis, zAxis) defining the quaternion.
Definition at line 640 of file qquaternion.cpp.
References Q_ASSERT, and toRotationMatrix().
void QQuaternion::getAxisAndAngle | ( | float * | x, |
float * | y, | ||
float * | z, | ||
float * | angle | ||
) | const |
Extracts a 3D axis (x, y, z) and a rotating angle angle (in degrees) that corresponds to this quaternion.
Definition at line 371 of file qquaternion.cpp.
References length(), Q_ASSERT, qFuzzyCompare, qFuzzyIsNull(), qHypot(), and qRadiansToDegrees().
Extracts a 3D axis axis and a rotating angle angle (in degrees) that corresponds to this quaternion.
Definition at line 307 of file qquaternion.h.
References getAxisAndAngle().
Referenced by getAxisAndAngle().
void QQuaternion::getEulerAngles | ( | float * | pitch, |
float * | yaw, | ||
float * | roll | ||
) | const |
Calculates roll, pitch, and yaw Euler angles (in degrees) that corresponds to this quaternion.
Definition at line 452 of file qquaternion.cpp.
References epsilon, length(), M_PI_2, Q_ASSERT, qFuzzyIsNull(), and qRadiansToDegrees().
Referenced by toEulerAngles().
|
inline |
Returns the inverse of this quaternion. If this quaternion is null, then a null quaternion is returned.
Definition at line 171 of file qquaternion.h.
References QQuaternion(), and qFuzzyIsNull().
Referenced by calculateParticleRotation(), QQuickQuaternionValueType::inverted(), and QAbstractPhysicsNode::updateFromPhysicsTransform().
|
inline |
Returns true
if the x, y, and z components of this quaternion are set to 0.0, and the scalar component is set to 1.0; otherwise returns false
.
Definition at line 150 of file qquaternion.h.
|
inline |
Returns true
if the x, y, z, and scalar components of this quaternion are set to 0.0; otherwise returns false
.
Definition at line 145 of file qquaternion.h.
float QQuaternion::length | ( | ) | const |
Returns the length of the quaternion.
This is also called the "norm".
Definition at line 199 of file qquaternion.cpp.
References qHypot().
Referenced by fromAxisAndAngle(), getAxisAndAngle(), getEulerAngles(), normalize(), and normalized().
float QQuaternion::lengthSquared | ( | ) | const |
Returns the squared length of the quaternion.
Definition at line 212 of file qquaternion.cpp.
|
static |
Interpolates along the shortest linear path between the rotational positions q1 and q2.
The value t should be between 0 and 1, indicating the distance to travel between q1 and q2. The result will be normalized().
If t is less than or equal to 0, then q1 will be returned. If t is greater than or equal to 1, then q2 will be returned.
The nlerp() function is typically faster than slerp() and will give approximate results to spherical interpolation that are good enough for some applications.
Definition at line 906 of file qquaternion.cpp.
References dot(), dotProduct(), and normalized().
Referenced by q_quaternionNlerpInterpolator().
void QQuaternion::normalize | ( | ) |
Normalizes the current quaternion in place.
Nothing happens if this is a null quaternion or the length of the quaternion is very close to 1.
Definition at line 241 of file qquaternion.cpp.
References length(), and qFuzzyIsNull().
QQuaternion QQuaternion::normalized | ( | ) | const |
Returns the normalized unit form of this quaternion.
If this quaternion is null, then a null quaternion is returned. If the length of the quaternion is very close to 1, then the quaternion will be returned as-is. Otherwise the normalized form of the quaternion of length 1 will be returned.
Definition at line 227 of file qquaternion.cpp.
References QQuaternion(), length(), and qFuzzyIsNull().
Referenced by QQuick3DNodePrivate::emitChangesToSceneTransform(), getPhysXWorldTransform(), RotationData::getQuaternionRotation(), QQuick3DInstancing::InstanceTableEntry::getRotation(), nlerp(), QQuickQuaternionValueType::normalized(), RotationData::operator=(), QQuick3DNode::rotate(), and QQuick3DNode::sceneRotation().
QQuaternion::operator QVariant | ( | ) | const |
Returns the quaternion as a QVariant.
Definition at line 928 of file qquaternion.cpp.
References QVariant::fromValue().
|
inline |
Multiplies this quaternion by quaternion and returns a reference to this quaternion.
Definition at line 232 of file qquaternion.h.
|
inline |
Multiplies this quaternion's components by the given factor, and returns a reference to this quaternion.
Definition at line 207 of file qquaternion.h.
|
inline |
Adds the given quaternion to this quaternion and returns a reference to this quaternion.
Definition at line 189 of file qquaternion.h.
|
inline |
Subtracts the given quaternion from this quaternion and returns a reference to this quaternion.
Definition at line 198 of file qquaternion.h.
|
inline |
Divides this quaternion's components by the given divisor, and returns a reference to this quaternion.
Definition at line 238 of file qquaternion.h.
Rotates vector with this quaternion to produce a new vector in 3D space.
The following code:
is equivalent to the following:
Definition at line 281 of file qquaternion.cpp.
References QQuaternion(), conjugated(), and vector().
Referenced by operator*(), and QSpatialSoundPrivate::updateRoomEffects().
|
static |
Returns the shortest arc quaternion to rotate from the direction described by the vector from to the direction described by the vector to.
Definition at line 712 of file qquaternion.cpp.
References QQuaternion(), QVector3D::crossProduct(), d, QVector3D::dotProduct(), QVector3D::lengthSquared(), QVector3D::normalize(), QVector3D::normalized(), qFuzzyIsNull(), v0, v1, QVector3D::x(), QVector3D::y(), and QVector3D::z().
Referenced by fromDirection().
|
inline |
Returns the scalar component of this quaternion.
Definition at line 159 of file qquaternion.h.
Referenced by fromRotationMatrix(), operator<<(), QMatrix4x4::rotate(), QAudioListener::setRotation(), and QPhysicsUtils::toPhysXType().
|
inline |
Sets the scalar component of this quaternion to scalar.
Definition at line 164 of file qquaternion.h.
Referenced by operator>>().
Sets the vector component of this quaternion to vector.
Definition at line 290 of file qquaternion.h.
References QVector3D::x(), QVector3D::y(), and QVector3D::z().
|
inline |
Sets the vector component of this quaternion to (x, y, z).
Definition at line 328 of file qquaternion.h.
|
inline |
Sets the x coordinate of this quaternion's vector to the given x coordinate.
Definition at line 161 of file qquaternion.h.
Referenced by operator>>().
|
inline |
Sets the y coordinate of this quaternion's vector to the given y coordinate.
Definition at line 162 of file qquaternion.h.
Referenced by operator>>().
|
inline |
Sets the z coordinate of this quaternion's vector to the given z coordinate.
Definition at line 163 of file qquaternion.h.
Referenced by operator>>().
|
static |
Interpolates along the shortest spherical path between the rotational positions q1 and q2.
The value t should be between 0 and 1, indicating the spherical distance to travel between q1 and q2.
If t is less than or equal to 0, then q1 will be returned. If t is greater than or equal to 1, then q2 will be returned.
Definition at line 857 of file qquaternion.cpp.
References dot(), and dotProduct().
Referenced by _q_interpolate(), and q_quaternionInterpolator().
|
inline |
Calculates roll, pitch, and yaw Euler angles (in degrees) that corresponds to this quaternion.
Definition at line 314 of file qquaternion.h.
References getEulerAngles().
Referenced by RotationData::getEulerRotation().
QMatrix3x3 QQuaternion::toRotationMatrix | ( | ) | const |
Creates a rotation matrix that corresponds to this quaternion.
Definition at line 553 of file qquaternion.cpp.
References Qt::Uninitialized.
Referenced by calculate(), QQuick3DInstancing::calculateTableEntryFromQuaternion(), QSSGRenderNode::calculateTransformMatrix(), getAxes(), QQuick3DNode::rotate(), QSSGRenderLayer::setProbeOrientation(), and RotationData::toRotationMatrix().
|
inline |
Returns this quaternion as a 4D vector.
Definition at line 340 of file qquaternion.h.
|
inline |
Returns the vector component of this quaternion.
Definition at line 297 of file qquaternion.h.
Referenced by rotatedVector().
|
inline |
Returns the x coordinate of this quaternion's vector.
Definition at line 156 of file qquaternion.h.
Referenced by operator<<(), QMatrix4x4::rotate(), QAudioListener::setRotation(), QPhysicsUtils::toPhysXType(), and QAbstractPhysicsNode::updateFromPhysicsTransform().
|
inline |
Returns the y coordinate of this quaternion's vector.
Definition at line 157 of file qquaternion.h.
Referenced by operator<<(), QMatrix4x4::rotate(), QAudioListener::setRotation(), QPhysicsUtils::toPhysXType(), and QAbstractPhysicsNode::updateFromPhysicsTransform().
|
inline |
Returns the z coordinate of this quaternion's vector.
Definition at line 158 of file qquaternion.h.
Referenced by operator<<(), QMatrix4x4::rotate(), QAudioListener::setRotation(), QPhysicsUtils::toPhysXType(), and QAbstractPhysicsNode::updateFromPhysicsTransform().
|
friend |
Returns true
if q1 is not equal to q2; otherwise returns false
.
This operator uses an exact floating-point comparison.
Definition at line 78 of file qquaternion.h.
|
related |
Multiplies q1 and q2 using quaternion multiplication.
The result corresponds to applying both of the rotations specified by q1 and q2.
Definition at line 216 of file qquaternion.h.
|
friend |
Multiplies q1 and q2 using quaternion multiplication.
The result corresponds to applying both of the rotations specified by q1 and q2.
Definition at line 216 of file qquaternion.h.
|
related |
Rotates a vector vec with a quaternion quaternion to produce a new vector in 3D space.
Definition at line 302 of file qquaternion.h.
References rotatedVector().
|
related |
Returns a copy of the given quaternion, multiplied by the given factor.
Definition at line 262 of file qquaternion.h.
|
friend |
Returns a copy of the given quaternion, multiplied by the given factor.
Definition at line 262 of file qquaternion.h.
|
related |
Returns a copy of the given quaternion, multiplied by the given factor.
Definition at line 257 of file qquaternion.h.
|
friend |
Returns a copy of the given quaternion, multiplied by the given factor.
Definition at line 257 of file qquaternion.h.
|
related |
Returns a QQuaternion object that is the sum of the given quaternions, q1 and q2; each component is added separately.
Definition at line 247 of file qquaternion.h.
|
friend |
Returns a QQuaternion object that is the sum of the given quaternions, q1 and q2; each component is added separately.
Definition at line 247 of file qquaternion.h.
|
related |
Returns a QQuaternion object that is formed by subtracting q2 from q1; each component is subtracted separately.
Definition at line 252 of file qquaternion.h.
|
friend |
Returns a QQuaternion object that is formed by subtracting q2 from q1; each component is subtracted separately.
Definition at line 252 of file qquaternion.h.
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QQuaternion object that is formed by changing the sign of all three components of the given quaternion.
Equivalent to {QQuaternion(0,0,0,0)
- quaternion}.
Definition at line 267 of file qquaternion.h.
|
friend |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a QQuaternion object that is formed by changing the sign of all three components of the given quaternion.
Equivalent to {QQuaternion(0,0,0,0)
- quaternion}.
Definition at line 267 of file qquaternion.h.
|
related |
Returns the QQuaternion object formed by dividing all components of the given quaternion by the given divisor.
Definition at line 272 of file qquaternion.h.
|
friend |
Returns the QQuaternion object formed by dividing all components of the given quaternion by the given divisor.
Definition at line 272 of file qquaternion.h.
|
related |
|
friend |
Returns true
if q1 is equal to q2; otherwise returns false
.
This operator uses an exact floating-point comparison.
Definition at line 74 of file qquaternion.h.
|
related |
Reads a quaternion from the given stream into the given quaternion and returns a reference to the stream.
Definition at line 975 of file qquaternion.cpp.
References setScalar(), setX(), setY(), and setZ().
|
related |
Returns true
if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.
Definition at line 277 of file qquaternion.h.
|
friend |
Returns true
if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.
Definition at line 277 of file qquaternion.h.
Referenced by fromAxisAndAngle(), and getAxisAndAngle().