45 #include <QtGui/qvector3d.h> 46 #include <QtGui/qvector4d.h> 54 #ifndef QT_NO_QUATERNION 64 #ifndef QT_NO_VECTOR3D 67 #ifndef QT_NO_VECTOR4D 72 bool isIdentity()
const;
74 #ifndef QT_NO_VECTOR3D 88 void setScalar(
qreal scalar);
91 qreal lengthSquared()
const;
118 #ifndef QT_NO_VECTOR4D 124 #ifndef QT_NO_VECTOR3D 203 qreal xx = ww + yy + zz;
216 *
this = *
this * quaternion;
231 return q1.
xp == q2.
xp && q1.
yp == q2.
yp && q1.
zp == q2.
zp && q1.
wp == q2.
wp;
236 return q1.
xp != q2.
xp || q1.
yp != q2.
yp || q1.
zp != q2.
zp || q1.
wp != q2.
wp;
251 return QQuaternion(quaternion.
wp * factor, quaternion.
xp * factor, quaternion.
yp * factor, quaternion.
zp * factor);
256 return QQuaternion(quaternion.
wp * factor, quaternion.
xp * factor, quaternion.
yp * factor, quaternion.
zp * factor);
266 return QQuaternion(quaternion.
wp / divisor, quaternion.
xp / divisor, quaternion.
yp / divisor, quaternion.
zp / divisor);
277 #ifndef QT_NO_VECTOR3D 280 :
wp(aScalar),
xp(aVector.
x()),
yp(aVector.
y()),
zp(aVector.
z()) {}
303 #ifndef QT_NO_VECTOR4D 306 :
wp(aVector.w()),
xp(aVector.
x()),
yp(aVector.
y()),
zp(aVector.
z()) {}
315 #ifndef QT_NO_DEBUG_STREAM 319 #ifndef QT_NO_DATASTREAM The QVariant class acts like a union for the most common Qt data types.
QDataStream & operator>>(QDataStream &stream, QEasingCurve &easing)
Reads an easing curve from the given stream into the given easing curve and returns a reference to th...
The QDebug class provides an output stream for debugging information.
QQuaternion()
Constructs an identity quaternion, i.
friend bool operator!=(const QQuaternion &q1, const QQuaternion &q2)
Returns true if q1 is not equal to q2; otherwise returns false.
The QVector3D class represents a vector or vertex in 3D space.
qreal x() const
Returns the x coordinate of this quaternion's vector.
#define QT_END_NAMESPACE
This macro expands to.
void setZ(qreal z)
Sets the z coordinate of this quaternion's vector to the given z coordinate.
bool isNull() const
Returns true if the x, y, z, and scalar components of this quaternion are set to 0.
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 a...
void setX(qreal x)
Sets the x coordinate of this quaternion's vector to the given x coordinate.
bool operator==(const QQuaternion &q1, const QQuaternion &q2)
The QVector4D class represents a vector or vertex in 4D space.
friend bool operator==(const QQuaternion &q1, const QQuaternion &q2)
Returns true if q1 is equal to q2; otherwise returns false.
friend const QQuaternion operator/(const QQuaternion &quaternion, qreal divisor)
Returns the QQuaternion object formed by dividing all components of the given quaternion by the given...
bool operator!=(const QQuaternion &q1, const QQuaternion &q2)
qreal x() const
Returns the x coordinate of this point.
bool isIdentity() const
Returns true if the x, y, and z components of this quaternion are set to 0.
static bool qIsNull(double d)
QQuaternion & operator-=(const QQuaternion &quaternion)
Subtracts the given quaternion from this quaternion and returns a reference to this quaternion...
QDataStream & operator<<(QDataStream &stream, const QQuaternion &quaternion)
Writes the given quaternion to the given stream and returns a reference to the stream.
QVector3D vector() const
Returns the vector component of this quaternion.
QQuaternion & operator/=(qreal divisor)
Divides this quaternion's components by the given divisor, and returns a reference to this quaternion...
QQuaternion & operator+=(const QQuaternion &quaternion)
Adds the given quaternion to this quaternion and returns a reference to this quaternion.
qreal scalar() const
Returns the scalar component of this quaternion.
#define QT_BEGIN_NAMESPACE
This macro expands to.
friend const QQuaternion operator*(qreal factor, const QQuaternion &quaternion)
void setScalar(qreal scalar)
Sets the scalar component of this quaternion to scalar.
Q_DECLARE_TYPEINFO(QQuaternion, Q_MOVABLE_TYPE)
void setVector(const QVector3D &vector)
Sets the vector component of this quaternion to vector.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
qreal z() const
Returns the z coordinate of this point.
bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2)
qreal y() const
Returns the y coordinate of this quaternion's vector.
const QQuaternion operator+(const QQuaternion &q1, const QQuaternion &q2)
qreal angle(const QPointF &p1, const QPointF &p2)
QQuaternion & operator*=(qreal factor)
Multiplies this quaternion's components by the given factor, and returns a reference to this quaterni...
qreal z() const
Returns the z coordinate of this quaternion's vector.
const QQuaternion operator-(const QQuaternion &q1, const QQuaternion &q2)
qreal y() const
Returns the y coordinate of this point.
The QQuaternion class represents a quaternion consisting of a vector and scalar.
QQuaternion conjugate() const
Returns the conjugate of this quaternion, which is (-x, -y, -z, scalar).
The QDataStream class provides serialization of binary data to a QIODevice.
const QQuaternion operator*(const QQuaternion &q1, const QQuaternion &q2)
timeval & operator+=(timeval &t1, const timeval &t2)
const QQuaternion operator/(const QQuaternion &quaternion, qreal divisor)
void setY(qreal y)
Sets the y coordinate of this quaternion's vector to the given y coordinate.
static void normalize(double &x, double &y)
friend 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 compari...
static bool isNull(const QVariant::Private *d)
friend 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 s...
QVector4D toVector4D() const
Returns this quaternion as a 4D vector.