#include <quat.h>
Inheritance diagram for NLMISC::CQuat:
Nevrax France
Definition at line 496 of file quat.h.
Public Member Functions | |
CQuatT | conjugate () const |
return the conjugate of this quaternion. | |
bool | equal (const CQuatT &a, float epsilon=1E-6f) const |
CQuatT | exp () |
compute quaternion exponent. | |
float | getAngle () const |
Return the equivalent angle of this quaternion. (in radian). | |
CAngleAxis | getAngleAxis () const |
Return the equivalent Unit AngleAxis of this quaternion. | |
CVector | getAxis () const |
Return the equivalent Unit axis of this quaternion. | |
void | identity () |
void | invert () |
Invert this quaternion. If normalized, conjugate is faster and does same thing. | |
CQuatT | inverted () const |
return the quaternion inverted. | |
bool | isIdentity () const |
CQuatT | log () |
compute logn quaternion. | |
void | makeClosest (const CQuatT &o) |
ensure that *this and q are on same side of hypersphere, ie dotProduct(*this,q) is >0, modifying this if necessary. | |
float | norm () const |
return the norm of the 4D vector. | |
void | normalize () |
Normalize the quaternion. | |
CQuatT | normed () const |
Return the quaternion normalized. | |
CQuatT | operator * (const CQuatT &) const |
Quaternion multiplication/composition. | |
CQuatT | operator * (floatf) const |
CQuatT & | operator *= (const CQuatT &) |
CQuatT & | operator *= (floatf) |
CQuatT | operator+ () const |
CQuatT | operator+ (const CQuatT &o) const |
CQuatT & | operator+= (const CQuatT &o) |
CQuatT | operator- () const |
CQuatT | operator- (const CQuatT &o) const |
CQuatT & | operator-= (const CQuatT &o) |
CQuatT | operator/ (floatf) const |
CQuatT & | operator/= (floatf) |
bool | operator== (const CQuatT &a) const |
void | serial (IStream &f) |
serial. | |
void | set (floatX, floatY, floatZ, floatW) |
void | setAngleAxis (const CAngleAxis &angAxis) |
Build a UNIT quaternion from an AngleAxis. | |
void | setAngleAxis (const CVector &axis, float angle) |
Build a UNIT quaternion from an AngleAxis. | |
float | sqrnorm () const |
return the square of the norm of the 4D vector. | |
Object | |
CQuat (const CAngleAxis &aa) | |
ctor of a UNIT quaternion, from an angle axis. | |
CQuat (const CVector &axis, float angle) | |
ctor of a UNIT quaternion, from an angle axis. | |
CQuat (float X, float Y, float Z, float W) | |
ctor of a UNIT quaternion, from an angle axis. | |
CQuat () | |
ctor of a UNIT quaternion, from an angle axis. | |
CQuat (const CQuatT< float > &o) | |
ctor of a UNIT quaternion, from an angle axis. | |
CQuat & | operator= (const CQuatT< float > &o) |
ctor of a UNIT quaternion, from an angle axis. | |
Static Public Member Functions | |
float | dotProduct (const CQuatT< float > &q0, const CQuatT< float > &q1) |
Return the dotProduct of 2 quaternions. | |
CQuatT | lnDif (const CQuatT &q0, const CQuatT &q1) |
compute lnDiff of q0.inverted()*q1. | |
CQuatT | slerp (const CQuatT< float > &q0, const CQuatT< float > &q1, float t) |
CQuatT | squad (const CQuatT< float > &q0, const CQuatT< float > &tgtQ0, const CQuatT< float > &tgtQ1, const CQuatT< float > &q1, float t) |
CQuatT | squadrev (const CAngleAxis &rot, const CQuatT< float > &q0, const CQuatT< float > &tgtQ0, const CQuatT< float > &tgtQ1, const CQuatT< float > &q1, float t) |
Data Fields | |
float | w |
float | x |
float | y |
float | z |
Static Public Attributes | |
const CQuat | Identity |
|
ctor of a UNIT quaternion, from an angle axis.
Definition at line 504 of file quat.h.
00504 : CQuatT<float>(o) {} |
|
ctor of a UNIT quaternion, from an angle axis.
Definition at line 505 of file quat.h.
00505 {} |
|
ctor of a UNIT quaternion, from an angle axis.
Definition at line 506 of file quat.h.
00506 : CQuatT<float>(X,Y,Z,W) {} |
|
ctor of a UNIT quaternion, from an angle axis.
Definition at line 508 of file quat.h.
00508 : CQuatT<float>(axis, angle) {} |
|
ctor of a UNIT quaternion, from an angle axis.
Definition at line 510 of file quat.h.
00510 : CQuatT<float>(aa) {} |
|
return the conjugate of this quaternion.
Definition at line 139 of file quat.h. References NLMISC::CQuatT< T >::CQuatT(), w, x, y, and z. Referenced by NL3D::CTargetAnimCtrl::execute(), and NL3D::CTargetAnimCtrl::getCurrentLSRotationFromBone().
|
|
Return the dotProduct of 2 quaternions.
|
|
|
|
compute quaternion exponent.
|
|
Return the equivalent angle of this quaternion. (in radian).
Definition at line 148 of file quat.h. References NLMISC::CQuatT< T >::norm(), and w. Referenced by NL3D::CTargetAnimCtrl::execute().
|
|
Return the equivalent Unit AngleAxis of this quaternion.
Definition at line 150 of file quat.h. References NLMISC::CQuatT< T >::getAngle(), and NLMISC::CQuatT< T >::getAxis(). Referenced by NL3D::CTargetAnimCtrl::execute().
|
|
Return the equivalent Unit axis of this quaternion.
Definition at line 146 of file quat.h. References NLMISC::CVector::normed(), x, y, and z.
|
|
Definition at line 102 of file quat.h.
|
|
Invert this quaternion. If normalized, conjugate is faster and does same thing.
|
|
return the quaternion inverted.
Definition at line 137 of file quat.h. References NLMISC::CQuatT< T >::invert().
00137 {CQuatT ret= *this; ret.invert(); return ret;} |
|
Definition at line 103 of file quat.h. Referenced by NLMISC::CMatrix::setRot().
|
|
compute lnDiff of q0.inverted()*q1.
|
|
compute logn quaternion.
|
|
ensure that *this and q are on same side of hypersphere, ie dotProduct(*this,q) is >0, modifying this if necessary.
Referenced by NL3D::CTargetAnimCtrl::execute(), NL3D::CTargetAnimCtrl::getCurrentLSRotationFromBone(), and NL3D::CAnimationOptimizer::sampleQuatTrack(). |
|
return the norm of the 4D vector.
Definition at line 121 of file quat.h. References NLMISC::CQuatT< T >::sqrnorm().
00121 {return (T)sqrt(sqrnorm());} |
|
Normalize the quaternion.
Referenced by NL3D::CAnimationOptimizer::sampleQuatTrack(). |
|
Return the quaternion normalized.
Definition at line 125 of file quat.h. References NLMISC::CQuatT< T >::normalize().
00125 {CQuatT ret= *this; ret.normalize(); return ret;} |
|
Quaternion multiplication/composition.
|
|
return the norm of the 4D vector.
Definition at line 114 of file quat.h. References NLMISC::CQuatT< T >::CQuatT(), w, x, y, and z.
|
|
return the conjugate of this quaternion.
|
|
return the norm of the 4D vector.
Definition at line 110 of file quat.h.
|
|
return the norm of the 4D vector.
Definition at line 117 of file quat.h.
00117 {return *this; } |
|
return the norm of the 4D vector.
Definition at line 112 of file quat.h. References NLMISC::CQuatT< T >::CQuatT(), NLMISC::CQuatT< T >::w, w, NLMISC::CQuatT< T >::x, x, NLMISC::CQuatT< T >::y, y, NLMISC::CQuatT< T >::z, and z.
|
|
return the norm of the 4D vector.
Definition at line 108 of file quat.h. References NLMISC::CQuatT< T >::w, w, NLMISC::CQuatT< T >::x, x, NLMISC::CQuatT< T >::y, y, NLMISC::CQuatT< T >::z, and z.
|
|
return the norm of the 4D vector.
Definition at line 116 of file quat.h. References NLMISC::CQuatT< T >::CQuatT(), w, x, y, and z.
|
|
return the norm of the 4D vector.
Definition at line 113 of file quat.h. References NLMISC::CQuatT< T >::CQuatT(), NLMISC::CQuatT< T >::w, w, NLMISC::CQuatT< T >::x, x, NLMISC::CQuatT< T >::y, y, NLMISC::CQuatT< T >::z, and z.
|
|
return the norm of the 4D vector.
Definition at line 109 of file quat.h. References NLMISC::CQuatT< T >::w, w, NLMISC::CQuatT< T >::x, x, NLMISC::CQuatT< T >::y, y, NLMISC::CQuatT< T >::z, and z.
|
|
return the norm of the 4D vector.
Definition at line 115 of file quat.h. References NLMISC::CQuatT< T >::CQuatT(), w, x, y, and z.
|
|
return the norm of the 4D vector.
Definition at line 111 of file quat.h.
|
|
ctor of a UNIT quaternion, from an angle axis.
Definition at line 503 of file quat.h. References NLMISC::CQuatT< T >::w, w, NLMISC::CQuatT< T >::x, x, NLMISC::CQuatT< T >::y, y, NLMISC::CQuatT< T >::z, and z.
|
|
Definition at line 100 of file quat.h. References NLMISC::CQuatT< T >::w, w, NLMISC::CQuatT< T >::x, x, NLMISC::CQuatT< T >::y, y, NLMISC::CQuatT< T >::z, and z.
|
|
serial.
Definition at line 168 of file quat.h. References NLMISC::IStream::serial(), w, x, y, and z.
|
|
Definition at line 95 of file quat.h. Referenced by NL3D::CTargetAnimCtrl::CTargetAnimCtrl().
|
|
Build a UNIT quaternion from an AngleAxis.
Definition at line 155 of file quat.h. References NLMISC::CAngleAxis::Angle, NLMISC::CAngleAxis::Axis, and NLMISC::CQuatT< T >::setAngleAxis().
00155 {setAngleAxis(angAxis.Axis, angAxis.Angle);} |
|
Build a UNIT quaternion from an AngleAxis.
Referenced by NL3D::CTargetAnimCtrl::execute(). |
|
Quaternion spherical linear interpolation. when t==0, ret==q0, when t==1, ret==q1. No hemisphere correction is made. Referenced by NL3D::CAnimatedValueBlendable< NLMISC::CQuat >::blend(). |
|
return the square of the norm of the 4D vector.
Definition at line 119 of file quat.h.
|
|
Quaternion Quadratic spherical linear interpolation. when t==0, ret==q0, when t==1, ret==q1. No hemisphere correction is made. |
|
Quaternion Quadratic spherical linear interpolation, with multi revision support. |
|
|
|
Definition at line 77 of file quat.h. Referenced by NLMISC::CQuatD::CQuatD(), NLMISC::CMatrix::getRot(), and NLMISC::CMatrix::setRot(). |
|
Definition at line 77 of file quat.h. Referenced by NLMISC::CQuatD::CQuatD(), NLMISC::CMatrix::getRot(), and NLMISC::CMatrix::setRot(). |
|
Definition at line 77 of file quat.h. Referenced by NLMISC::CQuatD::CQuatD(), NLMISC::CMatrix::getRot(), and NLMISC::CMatrix::setRot(). |
|
Definition at line 77 of file quat.h. Referenced by NLMISC::CQuatD::CQuatD(), NLMISC::CMatrix::getRot(), and NLMISC::CMatrix::setRot(). |