template <typename F> struct Quat_tpl { Vec3_tplv; F w; template <typename F> struct QuatT_tpl { Quat_tpl q; Vec3_tpl t; template <typename F> struct QuatTS_tpl { Quat_tpl q; Vec3_tpl t; F s; template <typename F> struct QuatTNS_tpl { Quat_tpl q; Vec3_tpl t; Vec3_tpl s; template <typename F> struct DualQuat_tpl { Quat_tpl nq; Quat_tpl dq; }; }; }; }; };
Cry_Quat.h
Quaternion
Cry_Quat.h
Quaternion with translation vector
Cry_Quat.h
Cry_Quat.h
Quaternion with translation vector and non-uniform scale
Cry_Quat.h
Dual Quaternion
Quat_tpldq;
Quat_tplnq;
template <class F1, class F2> DualQuat_tploperator *(const DualQuat_tpl & a, const DualQuat_tpl & b);
template <class F1, class F2> DualQuat_tploperator *(const DualQuat_tpl & l, const F2 r);
template <class F1, class F2> Vec3_tploperator *(const DualQuat_tpl & dq, const Vec3_tpl & v);
template <class F1, class F2> DualQuat_tploperator +(const DualQuat_tpl & l, const DualQuat_tpl & r);
template <class F1,class F2> void operator +=(DualQuat_tpl& l, const DualQuat_tpl & r);
DualQuat_tpl();
template <typename F1> DualQuat_tpl(const DualQuat_tpl& QDual);
DualQuat_tpl(const Matrix34_tpl& m34);
DualQuat_tpl(const QuatT_tpl& qt);
DualQuat_tpl(type_identity);
DualQuat_tpl(type_zero);
void Normalize();
void SetIdentity();
void SetZero();
typedef DualQuat_tplDualQuat;
always 32 bit
typedef DualQuat_tplDualQuatd;
always 64 bit
typedef DualQuat_tplDualQuatr;
variable float precision. depending on the target system it can be between 32, 64 or 80 bit
Quat_tplq;
Vec3_tpls;
Vec3_tplt;
template <class F1,class F2> QuatTNS_tploperator *(const QuatTNS_tpl & a, const QuatTNS_tpl & b);
template <class F1,class F2> QuatTNS_tploperator *(const QuatTNS_tpl & a, const QuatT_tpl & b);
template <class F1,class F2> QuatTNS_tploperator *(const QuatTNS_tpl & a, const Quat_tpl & b);
template <class F1,class F2> Vec3_tploperator *(const QuatTNS_tpl & q, const Vec3_tpl & v);
!
template <class F1,class F2> QuatTNS_tploperator *(const QuatT_tpl & a, const QuatTNS_tpl & b);
template <class F1,class F2> QuatTNS_tploperator *(const Quat_tpl & a, const QuatTNS_tpl & b);
QuatTNS_tpl& operator =(const QuatT_tpl& qt);
static QuatTNS_tplCreateNLerp(const QuatTNS_tpl & p, const QuatTNS_tpl & q, F t);
DEFINE_ALIGNED_DATA(QuatTNS, QuatTNSA, 16);
alligned versions
DEFINE_ALIGNED_DATA(QuatTNS_f64, QuatTNS_f64A, 64);
DEFINE_ALIGNED_DATA(QuatTNSr, QuatTNSrA, 64);
Vec3_tplGetColumn0() const;
Vec3_tplGetColumn1() const;
Vec3_tplGetColumn2() const;
Vec3_tplGetColumn3() const;
QuatTNS_tplGetInverted() const;
Vec3_tplGetRow0() const;
Vec3_tplGetRow1() const;
Vec3_tplGetRow2() const;
void Invert();
static bool IsEquivalent(const QuatTNS_tpl& qts1, const QuatTNS_tpl & qts2, F qe = RAD_EPSILON, F ve = VEC_EPSILON);
bool IsValid(F e = VEC_EPSILON) const;
QuatTNS_tpl();
explicit QuatTNS_tpl(const Matrix34_tpl& m);
template <typename F1> QuatTNS_tpl(const QuatTS_tpl& qts);
CONSTRUCTOR: implement the copy/casting/assignment constructor:
QuatTNS_tpl(const QuatT_tpl& qp);
QuatTNS_tpl(type_identity);
void SetIdentity();
void SetNLerp(const QuatTNS_tpl& p, const QuatTNS_tpl & tq, F ti);
typedef QuatTNS_tplQuatTNS;
typedef QuatTNS_tplQuatTNS_f64;
typedef QuatTNS_tplQuatTNSr;
Quat_tplq;
F s;
Vec3_tplt;
template <class F1,class F2> QuatTS_tploperator *(const QuatTS_tpl & a, const QuatTS_tpl & b);
template <class F1,class F2> QuatTS_tploperator *(const QuatTS_tpl & a, const QuatT_tpl & b);
template <class F1,class F2> QuatTS_tploperator *(const QuatTS_tpl & a, const Quat_tpl & b);
template <class F,class F2> Vec3_tploperator *(const QuatTS_tpl & q, const Vec3_tpl & v);
!
template <class F1,class F2> QuatTS_tploperator *(const QuatT_tpl & a, const QuatTS_tpl & b);
template <class F1,class F2> QuatTS_tploperator *(const Quat_tpl & a, const QuatTS_tpl & b);
QuatTS_tpl& operator =(const QuatT_tpl& qt);
static QuatTS_tplCreateNLerp(const QuatTS_tpl & p, const QuatTS_tpl & q, F t);
DEFINE_ALIGNED_DATA(QuatTS, QuatTSA, 16);
typedef __declspec(align(16)) Quat_tpl
DEFINE_ALIGNED_DATA(QuatTSd, QuatTSrA, 64);
typedef __declspec(align(16)) QuatTS_tpl
Vec3_tplGetColumn0() const;
Vec3_tplGetColumn1() const;
Vec3_tplGetColumn2() const;
Vec3_tplGetColumn3() const;
QuatTS_tplGetInverted() const;
Vec3_tplGetRow0() const;
Vec3_tplGetRow1() const;
Vec3_tplGetRow2() const;
void Invert();
static bool IsEquivalent(const QuatTS_tpl& qts1, const QuatTS_tpl & qts2, F qe = RAD_EPSILON, F ve = VEC_EPSILON);
bool IsValid(F e = VEC_EPSILON) const;
QuatTS_tpl();
explicit QuatTS_tpl(const Matrix34_tpl& m);
template <typename F1> QuatTS_tpl(const QuatTS_tpl& qts);
CONSTRUCTOR: implement the copy/casting/assignment constructor:
QuatTS_tpl(const QuatT_tpl& qp);
QuatTS_tpl(type_identity);
void SetIdentity();
void SetNLerp(const QuatTS_tpl& p, const QuatTS_tpl & tq, F ti);
typedef QuatTS_tplQuatTS;
always 64 bit
typedef QuatTS_tplQuatTSd;
always 64 bit
typedef QuatTS_tplQuatTSr;
variable float precision. depending on the target system it can be between 32, 64 or 80 bit
!
*
*
! *
*
*
DEFINE_ALIGNED_DATA(QuatTd, QuatTrA, 16);
typedef __declspec(align(16)) Quat_tpl
Vec3_tplGetColumn0() const;
Vec3_tplGetColumn1() const;
Vec3_tplGetColumn2() const;
Vec3_tplGetColumn3() const;
QuatT_tplGetInverted() const;
DEFINE_ALIGNED_DATA(QuatT, QuatTA, 32);
Vec3_tplGetRow0() const;
Vec3_tplGetRow1() const;
Vec3_tplGetRow2() const;
QuatT_tplGetScaled(F scale);
Quat_tplq;
this is the quaternion
void Invert();
static bool IsEquivalent(const QuatT_tpl& qt1, const QuatT_tpl & qt2, F qe = RAD_EPSILON, F ve = VEC_EPSILON);
bool IsIdentity() const;
bool IsValid() const;
QuatT_tpl();
QuatT_tpl(const DualQuat_tpl& qd);
convert unit DualQuat back to QuatT
Vec3_tplt;
this is the translation vector and a scalar (for uniform scaling?)
explicit QuatT_tpl(const Matrix34_tpl& m);
explicit QuatT_tpl(const QuatTS_tpl& qts);
template <typename F1> QuatT_tpl(const QuatT_tpl& qt);
CONSTRUCTOR: implement the copy/casting/assignment constructor:
QuatT_tpl(type_identity);
QuatT_tpl(type_zero);
initialize with zeros
void SetFromVectors(const Vec3& vx, const Vec3& vy, const Vec3& vz, const Vec3& pos);
all vectors are stored in columns
void SetIdentity();
void SetRotationXYZ(const Ang3_tpl& rad, const Vec3_tpl & trans = Vec3(ZERO));
!
*
*
void SetTranslation(const Vec3_tpl& trans);
typedef QuatT_tplQuatT;
always 32 bit
typedef QuatT_tplQuatTd;
always 64 bit
typedef QuatT_tplQuatTr;
variable float precision. depending on the target system it can be between 32, 64 or bit
Vec3_tplv;
F w;
Quat_tploperator -() const;
flip quaternion. don't confuse this with quaternion-inversion.
Quat_tploperator !() const;
!
*
bool operator !=(const Quat_tpl& q) const;
! Scale quaternion free function.
!
*
*
DEFINE_ALIGNED_DATA(Quat, QuatA, 16);
typedef __declspec(align(16)) Quat_tpl
void operator *=(F op);
multiplication by a scalar
Vec3_tplGetColumn(uint32 i);
A quaternion is a compressed matrix. Thus there is no problem extracting the rows & columns.
! *
*
*
bool operator ==(const Quat_tpl& q) const;
Exact compare of 2 quats.
static Quat_tplCreateIdentity();
static Quat_tplCreateRotationX(f32 r);
static Quat_tplCreateRotationXYZ(const Ang3_tpl & a);
static Quat_tplCreateRotationY(f32 r);
static Quat_tplCreateRotationZ(f32 r);
DEFINE_ALIGNED_DATA(Quatd, QuatrA, 32);
typedef __declspec(align(16)) Quat_tpl
Exponent of Quaternion.
Vec3_tplGetColumn0() const;
Vec3_tplGetColumn1() const;
Vec3_tplGetColumn2() const;
F GetFwdX() const;
These are just copy & pasted components of the GetColumn1() above.
F GetFwdY() const;
F GetFwdZ() const;
Quat_tplGetInverted() const;
F GetLength() const;
Quat_tplGetNormalized() const;
Quat_tplGetNormalizedFast() const;
Quat_tplGetNormalizedSafe() const;
F GetRotZ() const;
Vec3_tplGetRow0() const;
Vec3_tplGetRow1() const;
Vec3_tplGetRow2() const;
Quat_tplGetScaled(F scale) const;
useless, please delete
void Invert();
static bool IsEquivalent(const Quat_tpl& q1, const Quat_tpl & q2, F qe = RAD_EPSILON);
bool IsIdentity() const;
Check if identity quaternion.
bool IsUnit(F e = VEC_EPSILON) const;
bool IsValid(F e = VEC_EPSILON) const;
! Logarithm of Quaternion difference.
logarithm of a quaternion, imaginary part (the real part of the logarithm is always 0)
void Normalize();
!
*
*
void NormalizeFast();
void NormalizeSafe();
Quat_tpl();
template <class F1> explicit Quat_tpl(const Ang3_tpl & ang);
explicit Quat_tpl(const Ang3_tpl & ang);
Quat_tpl(F qw, F qx, F qy, F qz);
template <class F1> explicit Quat_tpl(const Matrix33_tpl & m);
explicit Quat_tpl(const Matrix33_tpl & m);
template <class F1> explicit Quat_tpl(const Matrix34_tpl & m);
explicit Quat_tpl(const Matrix34_tpl & m);
template <class F1> Quat_tpl(const Quat_tpl & q);
Quat_tpl(const Quat_tpl & q);
CONSTRUCTOR for identical types Quat q=q0;
Quat_tpl(type_identity);
Quat_tpl(type_zero);
initialize with zeros
!
*
void SetIdentity();
!
*
!
*
!
*
void SetRotationAA(F cosha, F sinha, const Vec3_tpl& axis);
void SetRotationAA(F rad, const Vec3_tpl& axis);
! *
*
void SetRotationVDir(const Vec3_tpl& vdir);
! *
*
*
*
*
*
void SetRotationVDir(const Vec3_tpl& vdir, F r);
void SetRotationX(f32 r);
!
*
void SetRotationXYZ(const Ang3_tpl& a);
!
*
void SetRotationY(f32 r);
!
*
void SetRotationZ(f32 r);
!
*
!
*
! squad(p,a,b,q,t) = slerp( slerp(p,q,t),slerp(a,b,t), 2(1-t)t).
typedef Quat_tplCryQuat;
typedef Quat_tplQuat;
always 32 bit
typedef Quat_tplQuatd;
always 64 bit
typedef Quat_tplquaternion;
typedef Quat_tplquaternionf;
typedef Quat_tplQuatr;
variable float precision. depending on the target system it can be between 32, 64 or 80 bit