Definition at line 59 of file qquaternion.h.
#include <qquaternion.h>
Public Member Functions |
|
| QQuaternion () | |
| QQuaternion (qreal scalar, qreal xpos, qreal ypos, qreal zpos) | |
| QQuaternion (qreal scalar, const QVector3D &vector) | |
| QQuaternion (const QVector4D &vector) | |
| bool | isNull () const |
| bool | isIdentity () const |
| QVector3D | vector () const |
| void | setVector (const QVector3D &vector) |
| void | setVector (qreal x, qreal y, qreal z) |
| qreal | x () const |
| qreal | y () const |
| qreal | z () const |
| qreal | scalar () const |
| void | setX (qreal x) |
| void | setY (qreal y) |
| void | setZ (qreal z) |
| void | setScalar (qreal scalar) |
| qreal | length () const |
| qreal | lengthSquared () const |
| QQuaternion | normalized () const |
| void | normalize () |
| QQuaternion | conjugate () const |
| QVector3D | rotatedVector (const QVector3D &vector) const |
| QQuaternion & | operator+= (const QQuaternion &quaternion) |
| QQuaternion & | operator-= (const QQuaternion &quaternion) |
| QQuaternion & | operator*= (qreal factor) |
| QQuaternion & | operator*= (const QQuaternion &quaternion) |
| QQuaternion & | operator/= (qreal divisor) |
| QVector4D | toVector4D () const |
| operator QVariant () const | |
Static Public Member Functions |
|
| static QQuaternion | fromAxisAndAngle (const QVector3D &axis, qreal angle) |
| static QQuaternion | fromAxisAndAngle (qreal x, qreal y, qreal z, qreal angle) |
| static QQuaternion | slerp (const QQuaternion &q1, const QQuaternion &q2, qreal t) |
| static QQuaternion | nlerp (const QQuaternion &q1, const QQuaternion &q2, qreal t) |
Friends |
|
| bool | operator== (const QQuaternion &q1, const QQuaternion &q2) |
| bool | operator!= (const QQuaternion &q1, const QQuaternion &q2) |
| const QQuaternion | operator+ (const QQuaternion &q1, const QQuaternion &q2) |
| const QQuaternion | operator- (const QQuaternion &q1, const QQuaternion &q2) |
| const QQuaternion | operator* (qreal factor, const QQuaternion &quaternion) |
| const QQuaternion | operator* (const QQuaternion &quaternion, qreal factor) |
| const QQuaternion | operator* (const QQuaternion &q1, const QQuaternion &q2) |
| const QQuaternion | operator- (const QQuaternion &quaternion) |
| const QQuaternion | operator/ (const QQuaternion &quaternion, qreal divisor) |
| bool | qFuzzyCompare (const QQuaternion &q1, const QQuaternion &q2) |
| QQuaternion | ( | ) | [inline] |
Definition at line 141 of file qquaternion.h.
: wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {}
| QQuaternion | ( | qreal | scalar, |
| qreal | xpos, | ||
| qreal | ypos, | ||
| qreal | zpos | ||
| ) | [inline] |
Definition at line 143 of file qquaternion.h.
: wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {}
| QQuaternion | ( | qreal | scalar, |
| const QVector3D & | vector | ||
| ) | [inline] |
Definition at line 279 of file qquaternion.h.
: wp(aScalar), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {}
| QQuaternion | ( | const QVector4D & | vector | ) | [inline, explicit] |
Definition at line 305 of file qquaternion.h.
: wp(aVector.w()), xp(aVector.x()), yp(aVector.y()), zp(aVector.z()) {}
| bool isNull | ( | ) | const [inline] |
Definition at line 146 of file qquaternion.h.
{
return qIsNull(xp) && qIsNull(yp) && qIsNull(zp) && qIsNull(wp);
}
| bool isIdentity | ( | ) | const [inline] |
Definition at line 151 of file qquaternion.h.
{
return qIsNull(xp) && qIsNull(yp) && qIsNull(zp) && wp == 1.0f;
}
| QVector3D vector | ( | ) | const [inline] |
Definition at line 289 of file qquaternion.h.
{
return QVector3D(xp, yp, zp);
}
| void setVector | ( | const QVector3D & | vector | ) | [inline] |
Definition at line 282 of file qquaternion.h.
{
xp = aVector.x();
yp = aVector.y();
zp = aVector.z();
}
| void setVector | ( | qreal | x, |
| qreal | y, | ||
| qreal | z | ||
| ) | [inline] |
Definition at line 296 of file qquaternion.h.
{
xp = aX;
yp = aY;
zp = aZ;
}
| qreal x | ( | ) | const [inline] |
| qreal y | ( | ) | const [inline] |
| qreal z | ( | ) | const [inline] |
| qreal scalar | ( | ) | const [inline] |
| void setX | ( | qreal | x | ) | [inline] |
| void setY | ( | qreal | y | ) | [inline] |
| void setZ | ( | qreal | z | ) | [inline] |
| void setScalar | ( | qreal | scalar | ) | [inline] |
| qreal length | ( | ) | const |
| qreal lengthSquared | ( | ) | const |
| QQuaternion normalized | ( | ) | const |
| void normalize | ( | ) |
| QQuaternion conjugate | ( | ) | const [inline] |
Definition at line 166 of file qquaternion.h.
{
return QQuaternion(wp, -xp, -yp, -zp);
}
| QQuaternion & operator+= | ( | const QQuaternion & | quaternion | ) | [inline] |
Definition at line 171 of file qquaternion.h.
{
xp += quaternion.xp;
yp += quaternion.yp;
zp += quaternion.zp;
wp += quaternion.wp;
return *this;
}
| QQuaternion & operator-= | ( | const QQuaternion & | quaternion | ) | [inline] |
Definition at line 180 of file qquaternion.h.
{
xp -= quaternion.xp;
yp -= quaternion.yp;
zp -= quaternion.zp;
wp -= quaternion.wp;
return *this;
}
| QQuaternion & operator*= | ( | qreal | factor | ) | [inline] |
Definition at line 189 of file qquaternion.h.
{
xp *= factor;
yp *= factor;
zp *= factor;
wp *= factor;
return *this;
}
| QQuaternion & operator*= | ( | const QQuaternion & | quaternion | ) | [inline] |
Definition at line 214 of file qquaternion.h.
{
*this = *this * quaternion;
return *this;
}
| QQuaternion & operator/= | ( | qreal | divisor | ) | [inline] |
Definition at line 220 of file qquaternion.h.
{
xp /= divisor;
yp /= divisor;
zp /= divisor;
wp /= divisor;
return *this;
}
| QVector4D toVector4D | ( | ) | const [inline] |
Definition at line 308 of file qquaternion.h.
{
return QVector4D(xp, yp, zp, wp);
}
| operator QVariant | ( | ) | const |
| static QQuaternion fromAxisAndAngle | ( | const QVector3D & | axis, |
| qreal | angle | ||
| ) | [static] |
| static QQuaternion fromAxisAndAngle | ( | qreal | x, |
| qreal | y, | ||
| qreal | z, | ||
| qreal | angle | ||
| ) | [static] |
| static QQuaternion slerp | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2, | ||
| qreal | t | ||
| ) | [static] |
| static QQuaternion nlerp | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2, | ||
| qreal | t | ||
| ) | [static] |
| bool operator== | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2 | ||
| ) | [friend] |
Definition at line 229 of file qquaternion.h.
{
return q1.xp == q2.xp && q1.yp == q2.yp && q1.zp == q2.zp && q1.wp == q2.wp;
}
| bool operator!= | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2 | ||
| ) | [friend] |
Definition at line 234 of file qquaternion.h.
{
return q1.xp != q2.xp || q1.yp != q2.yp || q1.zp != q2.zp || q1.wp != q2.wp;
}
| const QQuaternion operator+ | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2 | ||
| ) | [friend] |
Definition at line 239 of file qquaternion.h.
{
return QQuaternion(q1.wp + q2.wp, q1.xp + q2.xp, q1.yp + q2.yp, q1.zp + q2.zp);
}
| const QQuaternion operator- | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2 | ||
| ) | [friend] |
Definition at line 244 of file qquaternion.h.
{
return QQuaternion(q1.wp - q2.wp, q1.xp - q2.xp, q1.yp - q2.yp, q1.zp - q2.zp);
}
| const QQuaternion operator* | ( | qreal | factor, |
| const QQuaternion & | quaternion | ||
| ) | [friend] |
Definition at line 249 of file qquaternion.h.
{
return QQuaternion(quaternion.wp * factor, quaternion.xp * factor, quaternion.yp * factor, quaternion.zp * factor);
}
| const QQuaternion operator* | ( | const QQuaternion & | quaternion, |
| qreal | factor | ||
| ) | [friend] |
Definition at line 254 of file qquaternion.h.
{
return QQuaternion(quaternion.wp * factor, quaternion.xp * factor, quaternion.yp * factor, quaternion.zp * factor);
}
| const QQuaternion operator* | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2 | ||
| ) | [friend] |
Definition at line 198 of file qquaternion.h.
{
qreal ww = (q1.zp + q1.xp) * (q2.xp + q2.yp);
qreal yy = (q1.wp - q1.yp) * (q2.wp + q2.zp);
qreal zz = (q1.wp + q1.yp) * (q2.wp - q2.zp);
qreal xx = ww + yy + zz;
qreal qq = 0.5 * (xx + (q1.zp - q1.xp) * (q2.xp - q2.yp));
qreal w = qq - ww + (q1.zp - q1.yp) * (q2.yp - q2.zp);
qreal x = qq - xx + (q1.xp + q1.wp) * (q2.xp + q2.wp);
qreal y = qq - yy + (q1.wp - q1.xp) * (q2.yp + q2.zp);
qreal z = qq - zz + (q1.zp + q1.yp) * (q2.wp - q2.xp);
return QQuaternion(w, x, y, z);
}
| const QQuaternion operator- | ( | const QQuaternion & | quaternion | ) | [friend] |
Definition at line 259 of file qquaternion.h.
{
return QQuaternion(-quaternion.wp, -quaternion.xp, -quaternion.yp, -quaternion.zp);
}
| const QQuaternion operator/ | ( | const QQuaternion & | quaternion, |
| qreal | divisor | ||
| ) | [friend] |
Definition at line 264 of file qquaternion.h.
{
return QQuaternion(quaternion.wp / divisor, quaternion.xp / divisor, quaternion.yp / divisor, quaternion.zp / divisor);
}
| bool qFuzzyCompare | ( | const QQuaternion & | q1, |
| const QQuaternion & | q2 | ||
| ) | [friend] |
Definition at line 269 of file qquaternion.h.
{
return qFuzzyCompare(q1.xp, q2.xp) &&
qFuzzyCompare(q1.yp, q2.yp) &&
qFuzzyCompare(q1.zp, q2.zp) &&
qFuzzyCompare(q1.wp, q2.wp);
}