Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuaternion Class Reference

The QQuaternion class represents a quaternion consisting of a vector and scalar. More...

+ Collaboration diagram for QQuaternion:

Related Symbols

(Note that these are not member symbols.)

const QQuaternion operator+ (const QQuaternion &q1, const QQuaternion &q2) noexcept
 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) noexcept
 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) noexcept
 Returns a copy of the given quaternion, multiplied by the given factor.
 
const QQuaternion operator* (const QQuaternion &quaternion, float factor) noexcept
 Returns a copy of the given quaternion, multiplied by the given factor.
 
const QQuaternion operator* (const QQuaternion &q1, const QQuaternion &q2) noexcept
 Multiplies q1 and q2 using quaternion multiplication.
 
const QQuaternion operator- (const QQuaternion &quaternion) noexcept
 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) noexcept
 
bool qFuzzyCompare (const QQuaternion &q1, const QQuaternion &q2) noexcept
 Returns true if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.
 
QDataStreamoperator<< (QDataStream &stream, const QQuaternion &quaternion)
 Writes the given quaternion to the given stream and returns a reference to the stream.
 
QDataStreamoperator>> (QDataStream &stream, QQuaternion &quaternion)
 Reads a quaternion from the given stream into the given quaternion and returns a reference to the stream.
 

Detailed Description

The QQuaternion class represents a quaternion consisting of a vector and scalar.

Since
4.6

\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.

Friends And Related Symbol Documentation

◆ operator*() [1/4]

const QQuaternion operator* ( const QQuaternion & q1,
const QQuaternion & q2 )
related

Multiplies q1 and q2 using quaternion multiplication.

The result corresponds to applying both of the rotations specified by q1 and q2.

See also
QQuaternion::operator*=()

Definition at line 223 of file qquaternion.h.

◆ operator*() [2/4]

QVector3D operator* ( const QQuaternion & quaternion,
const QVector3D & vec )
related
Since
5.5

Rotates a vector vec with a quaternion quaternion to produce a new vector in 3D space.

Definition at line 309 of file qquaternion.h.

◆ operator*() [3/4]

const QQuaternion operator* ( const QQuaternion & quaternion,
float factor )
related

Returns a copy of the given quaternion, multiplied by the given factor.

See also
QQuaternion::operator*=()

Definition at line 269 of file qquaternion.h.

◆ operator*() [4/4]

const QQuaternion operator* ( float factor,
const QQuaternion & quaternion )
related

Returns a copy of the given quaternion, multiplied by the given factor.

See also
QQuaternion::operator*=()

Definition at line 264 of file qquaternion.h.

◆ operator+()

const QQuaternion operator+ ( const QQuaternion & q1,
const QQuaternion & q2 )
related

Returns a QQuaternion object that is the sum of the given quaternions, q1 and q2; each component is added separately.

See also
QQuaternion::operator+=()

Definition at line 254 of file qquaternion.h.

◆ operator-() [1/2]

const QQuaternion operator- ( const QQuaternion & q1,
const QQuaternion & q2 )
related

Returns a QQuaternion object that is formed by subtracting q2 from q1; each component is subtracted separately.

See also
QQuaternion::operator-=()

Definition at line 259 of file qquaternion.h.

◆ operator-() [2/2]

const QQuaternion operator- ( const QQuaternion & quaternion)
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 274 of file qquaternion.h.

◆ operator/()

const QQuaternion operator/ ( const QQuaternion & quaternion,
float divisor )
related

Returns the QQuaternion object formed by dividing all components of the given quaternion by the given divisor.

See also
QQuaternion::operator/=()

Definition at line 279 of file qquaternion.h.

◆ operator<<()

QDataStream & operator<< ( QDataStream & stream,
const QQuaternion & quaternion )
related

Writes the given quaternion to the given stream and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 958 of file qquaternion.cpp.

◆ operator>>()

QDataStream & operator>> ( QDataStream & stream,
QQuaternion & quaternion )
related

Reads a quaternion from the given stream into the given quaternion and returns a reference to the stream.

See also
{Serializing Qt Data Types}

Definition at line 975 of file qquaternion.cpp.

◆ qFuzzyCompare()

bool qFuzzyCompare ( const QQuaternion & q1,
const QQuaternion & q2 )
related

Returns true if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.

Definition at line 284 of file qquaternion.h.

References qFuzzyCompare().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: