Skip to end of metadata
Go to start of metadata
You are here: Common > Math > Quat_tpl Structure
Quat_tpl Structure
C++
template <typename F>
struct Quat_tpl {
  Vec3_tpl<F> v;
  F w;
  template <typename F>
struct QuatT_tpl {
    Quat_tpl<F> q;
    Vec3_tpl<F> t;
    template <typename F>
struct QuatTS_tpl {
      Quat_tpl<F> q;
      Vec3_tpl<F> t;
      F s;
      template <typename F>
struct QuatTNS_tpl {
        Quat_tpl<F> q;
        Vec3_tpl<F> t;
        Vec3_tpl<F> s;
        template <typename F>
struct DualQuat_tpl {
          Quat_tpl<F> nq;
          Quat_tpl<F> dq;
        };
      };
    };
  };
};
File

Cry_Quat.h

Description

Quaternion

Quat_tpl::QuatT_tpl Structure
C++
template <typename F>
struct QuatT_tpl {
  Quat_tpl<F> q;
  Vec3_tpl<F> t;
  template <typename F>
struct QuatTS_tpl {
    Quat_tpl<F> q;
    Vec3_tpl<F> t;
    F s;
    template <typename F>
struct QuatTNS_tpl {
      Quat_tpl<F> q;
      Vec3_tpl<F> t;
      Vec3_tpl<F> s;
      template <typename F>
struct DualQuat_tpl {
        Quat_tpl<F> nq;
        Quat_tpl<F> dq;
      };
    };
  };
};
File

Cry_Quat.h

Description

Quaternion with translation vector

Quat_tpl::QuatT_tpl::QuatTS_tpl Structure
C++
template <typename F>
struct QuatTS_tpl {
  Quat_tpl<F> q;
  Vec3_tpl<F> t;
  F s;
  template <typename F>
struct QuatTNS_tpl {
    Quat_tpl<F> q;
    Vec3_tpl<F> t;
    Vec3_tpl<F> s;
    template <typename F>
struct DualQuat_tpl {
      Quat_tpl<F> nq;
      Quat_tpl<F> dq;
    };
  };
};
File

Cry_Quat.h

Description

Quaternion with translation vector and scale Similar to QuatT, but s is not ignored. Most functions then differ, so we don't inherit.

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl Structure
C++
template <typename F>
struct QuatTNS_tpl {
  Quat_tpl<F> q;
  Vec3_tpl<F> t;
  Vec3_tpl<F> s;
  template <typename F>
struct DualQuat_tpl {
    Quat_tpl<F> nq;
    Quat_tpl<F> dq;
  };
};
File

Cry_Quat.h

Description

Quaternion with translation vector and non-uniform scale

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl Structure
C++
template <typename F>
struct DualQuat_tpl {
  Quat_tpl<F> nq;
  Quat_tpl<F> dq;
};
File

Cry_Quat.h

Description

Dual Quaternion

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::dq Data Member
C++
Quat_tpl<F> dq;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::nq Data Member
C++
Quat_tpl<F> nq;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::* Operator (DualQuat_tpl<F1> &, DualQuat_tpl<F2> &)
C++
template <class F1, class F2> DualQuat_tpl<F1> operator *(const DualQuat_tpl<F1> & a, const DualQuat_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::* Operator (DualQuat_tpl<F1> &, F2)
C++
template <class F1, class F2> DualQuat_tpl<F1> operator *(const DualQuat_tpl<F1> & l, const F2 r);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::* Operator (DualQuat_tpl<F1> &, Vec3_tpl<F2> &)
C++
template <class F1, class F2> Vec3_tpl<F1> operator *(const DualQuat_tpl<F1> & dq, const Vec3_tpl<F2> & v);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::+ Operator
C++
template <class F1, class F2> DualQuat_tpl<F1> operator +(const DualQuat_tpl<F1> & l, const DualQuat_tpl<F2> & r);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::+= Operator
C++
template <class F1,class F2> void operator +=(DualQuat_tpl<F1> & l, const DualQuat_tpl<F2> & r);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor ()
C++
DualQuat_tpl();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor (DualQuat_tpl<F1>&)
C++
template <typename F1> DualQuat_tpl(const DualQuat_tpl<F1>& QDual);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor (Matrix34_tpl<F>&)
C++
DualQuat_tpl(const Matrix34_tpl<F>& m34);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor (QuatT_tpl<F>&)
C++
DualQuat_tpl(const QuatT_tpl<F>& qt);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor (Quat_tpl<F>&, Vec3_tpl<F>&)
C++
DualQuat_tpl(const Quat_tpl<F>& q, const Vec3_tpl<F>& t);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor (type_identity)
C++
DualQuat_tpl(type_identity);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat_tpl Constructor (type_zero)
C++
DualQuat_tpl(type_zero);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::Normalize Method
C++
void Normalize();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::SetIdentity Method
C++
void SetIdentity();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::SetZero Method
C++
void SetZero();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuat Nested Type
C++
typedef DualQuat_tpl<f32> DualQuat;
Description

always 32 bit

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuatd Nested Type
C++
typedef DualQuat_tpl<f64> DualQuatd;
Description

always 64 bit

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DualQuat_tpl::DualQuatr Nested Type
C++
typedef DualQuat_tpl<real> DualQuatr;
Description

variable float precision. depending on the target system it can be between 32, 64 or 80 bit

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::q Data Member
C++
Quat_tpl<F> q;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::s Data Member
C++
Vec3_tpl<F> s;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::t Data Member
C++
Vec3_tpl<F> t;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::* Operator (QuatTNS_tpl<F1> &, QuatTNS_tpl<F2> &)
C++
template <class F1,class F2> QuatTNS_tpl<F1> operator *(const QuatTNS_tpl<F1> & a, const QuatTNS_tpl<F2> & b);
Description

!

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::* Operator (QuatTNS_tpl<F1> &, QuatT_tpl<F2> &)
C++
template <class F1,class F2> QuatTNS_tpl<F1> operator *(const QuatTNS_tpl<F1> & a, const QuatT_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::* Operator (QuatTNS_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> QuatTNS_tpl<F1> operator *(const QuatTNS_tpl<F1> & a, const Quat_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::* Operator (QuatTNS_tpl<F1> &, Vec3_tpl<F2> &)
C++
template <class F1,class F2> Vec3_tpl<F1> operator *(const QuatTNS_tpl<F1> & q, const Vec3_tpl<F2> & v);
Description

!

  • post-multiply of a QuatTNS and a Vec3 (3D rotations with quaternions)
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::* Operator (QuatT_tpl<F1> &, QuatTNS_tpl<F2> &)
C++
template <class F1,class F2> QuatTNS_tpl<F1> operator *(const QuatT_tpl<F1> & a, const QuatTNS_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::* Operator (Quat_tpl<F1> &, QuatTNS_tpl<F2> &)
C++
template <class F1,class F2> QuatTNS_tpl<F1> operator *(const Quat_tpl<F1> & a, const QuatTNS_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::= Operator
C++
QuatTNS_tpl& operator =(const QuatT_tpl<F> & qt);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::CreateNLerp Method
C++
static QuatTNS_tpl<F> CreateNLerp(const QuatTNS_tpl<F> & p, const QuatTNS_tpl<F> & q, F t);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DEFINE_ALIGNED_DATA Method (QuatTNS, QuatTNSA, 16)
C++
DEFINE_ALIGNED_DATA(QuatTNS, QuatTNSA, 16);
Description

alligned versions

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DEFINE_ALIGNED_DATA Method (QuatTNS_f64, QuatTNS_f64A, 64)
C++
DEFINE_ALIGNED_DATA(QuatTNS_f64, QuatTNS_f64A, 64);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::DEFINE_ALIGNED_DATA Method (QuatTNSr, QuatTNSrA, 64)
C++
DEFINE_ALIGNED_DATA(QuatTNSr, QuatTNSrA, 64);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetColumn0 Method
C++
Vec3_tpl<F> GetColumn0() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetColumn1 Method
C++
Vec3_tpl<F> GetColumn1() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetColumn2 Method
C++
Vec3_tpl<F> GetColumn2() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetColumn3 Method
C++
Vec3_tpl<F> GetColumn3() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetInverted Method
C++
QuatTNS_tpl<F> GetInverted() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetRow0 Method
C++
Vec3_tpl<F> GetRow0() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetRow1 Method
C++
Vec3_tpl<F> GetRow1() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::GetRow2 Method
C++
Vec3_tpl<F> GetRow2() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::Invert Method
C++
void Invert();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::IsEquivalent Method
C++
static bool IsEquivalent(const QuatTNS_tpl<F>& qts1, const QuatTNS_tpl<F>& qts2, F qe = RAD_EPSILON, F ve = VEC_EPSILON);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::IsValid Method
C++
bool IsValid(F e = VEC_EPSILON) const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_tpl Constructor ()
C++
QuatTNS_tpl();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_tpl Constructor (Matrix34_tpl<F>&)
C++
explicit QuatTNS_tpl(const Matrix34_tpl<F>& m);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_tpl Constructor (QuatTS_tpl<F1>&)
C++
template <typename F1> QuatTNS_tpl(const QuatTS_tpl<F1>& qts);
Description

CONSTRUCTOR: implement the copy/casting/assignment constructor:

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_tpl Constructor (QuatT_tpl<F>&)
C++
QuatTNS_tpl(const QuatT_tpl<F>& qp);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_tpl Constructor (Quat_tpl<F>&, Vec3_tpl<F>&, Vec3_tpl<F>&)
C++
QuatTNS_tpl(const Quat_tpl<F>& quat, const Vec3_tpl<F>& trans, const Vec3_tpl<F>& scale = Vec3_tpl<F>(1));
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_tpl Constructor (type_identity)
C++
QuatTNS_tpl(type_identity);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::SetIdentity Method
C++
void SetIdentity();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::SetNLerp Method
C++
void SetNLerp(const QuatTNS_tpl<F> & p, const QuatTNS_tpl<F> & tq, F ti);
Description

!

  • linear-interpolation between quaternions (nlerp)

*

  • Example:
  • CQuaternion result,p,q;
  • result=qlerp( p, q, 0.5f );
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS Nested Type
C++
typedef QuatTNS_tpl<f32> QuatTNS;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNS_f64 Nested Type
C++
typedef QuatTNS_tpl<f64> QuatTNS_f64;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTNS_tpl::QuatTNSr Nested Type
C++
typedef QuatTNS_tpl<f64> QuatTNSr;
Quat_tpl::QuatT_tpl::QuatTS_tpl::q Data Member
C++
Quat_tpl<F> q;
Quat_tpl::QuatT_tpl::QuatTS_tpl::s Data Member
C++
F s;
Quat_tpl::QuatT_tpl::QuatTS_tpl::t Data Member
C++
Vec3_tpl<F> t;
Quat_tpl::QuatT_tpl::QuatTS_tpl::* Operator (QuatTS_tpl<F1> &, QuatTS_tpl<F2> &)
C++
template <class F1,class F2> QuatTS_tpl<F1> operator *(const QuatTS_tpl<F1> & a, const QuatTS_tpl<F2> & b);
Description

!

Quat_tpl::QuatT_tpl::QuatTS_tpl::* Operator (QuatTS_tpl<F1> &, QuatT_tpl<F2> &)
C++
template <class F1,class F2> QuatTS_tpl<F1> operator *(const QuatTS_tpl<F1> & a, const QuatT_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::* Operator (QuatTS_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> QuatTS_tpl<F1> operator *(const QuatTS_tpl<F1> & a, const Quat_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::* Operator (QuatTS_tpl<F> &, Vec3_tpl<F2> &)
C++
template <class F,class F2> Vec3_tpl<F> operator *(const QuatTS_tpl<F> & q, const Vec3_tpl<F2> & v);
Description

!

  • post-multiply of a QuatT and a Vec3 (3D rotations with quaternions)
Quat_tpl::QuatT_tpl::QuatTS_tpl::* Operator (QuatT_tpl<F1> &, QuatTS_tpl<F2> &)
C++
template <class F1,class F2> QuatTS_tpl<F1> operator *(const QuatT_tpl<F1> & a, const QuatTS_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::* Operator (Quat_tpl<F1> &, QuatTS_tpl<F2> &)
C++
template <class F1,class F2> QuatTS_tpl<F1> operator *(const Quat_tpl<F1> & a, const QuatTS_tpl<F2> & b);
Quat_tpl::QuatT_tpl::QuatTS_tpl::= Operator
C++
QuatTS_tpl& operator =(const QuatT_tpl<F> & qt);
Quat_tpl::QuatT_tpl::QuatTS_tpl::CreateNLerp Method
C++
static QuatTS_tpl<F> CreateNLerp(const QuatTS_tpl<F> & p, const QuatTS_tpl<F> & q, F t);
Quat_tpl::QuatT_tpl::QuatTS_tpl::DEFINE_ALIGNED_DATA Method (QuatTS, QuatTSA, 16)
C++
DEFINE_ALIGNED_DATA(QuatTS, QuatTSA, 16);
Description

typedef __declspec(align(16)) Quat_tpl

Quat_tpl::QuatT_tpl::QuatTS_tpl::DEFINE_ALIGNED_DATA Method (QuatTSd, QuatTSrA, 64)
C++
DEFINE_ALIGNED_DATA(QuatTSd, QuatTSrA, 64);
Description

typedef __declspec(align(16)) QuatTS_tpl

Quat_tpl::QuatT_tpl::QuatTS_tpl::GetColumn0 Method
C++
Vec3_tpl<F> GetColumn0() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetColumn1 Method
C++
Vec3_tpl<F> GetColumn1() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetColumn2 Method
C++
Vec3_tpl<F> GetColumn2() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetColumn3 Method
C++
Vec3_tpl<F> GetColumn3() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetInverted Method
C++
QuatTS_tpl<F> GetInverted() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetRow0 Method
C++
Vec3_tpl<F> GetRow0() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetRow1 Method
C++
Vec3_tpl<F> GetRow1() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::GetRow2 Method
C++
Vec3_tpl<F> GetRow2() const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::Invert Method
C++
void Invert();
Quat_tpl::QuatT_tpl::QuatTS_tpl::IsEquivalent Method
C++
static bool IsEquivalent(const QuatTS_tpl<F>& qts1, const QuatTS_tpl<F>& qts2, F qe = RAD_EPSILON, F ve = VEC_EPSILON);
Quat_tpl::QuatT_tpl::QuatTS_tpl::IsValid Method
C++
bool IsValid(F e = VEC_EPSILON) const;
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS_tpl Constructor ()
C++
QuatTS_tpl();
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS_tpl Constructor (Matrix34_tpl<F>&)
C++
explicit QuatTS_tpl(const Matrix34_tpl<F>& m);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS_tpl Constructor (QuatTS_tpl<F1>&)
C++
template <typename F1> QuatTS_tpl(const QuatTS_tpl<F1>& qts);
Description

CONSTRUCTOR: implement the copy/casting/assignment constructor:

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS_tpl Constructor (QuatT_tpl<F>&)
C++
QuatTS_tpl(const QuatT_tpl<F>& qp);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS_tpl Constructor (Quat_tpl<F>&, Vec3_tpl<F>&, F)
C++
QuatTS_tpl(const Quat_tpl<F>& quat, const Vec3_tpl<F>& trans, F scale = 1);
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS_tpl Constructor (type_identity)
C++
QuatTS_tpl(type_identity);
Quat_tpl::QuatT_tpl::QuatTS_tpl::SetIdentity Method
C++
void SetIdentity();
Quat_tpl::QuatT_tpl::QuatTS_tpl::SetNLerp Method
C++
void SetNLerp(const QuatTS_tpl<F> & p, const QuatTS_tpl<F> & tq, F ti);
Description

!

  • linear-interpolation between quaternions (nlerp)

*

  • Example:
  • CQuaternion result,p,q;
  • result=qlerp( p, q, 0.5f );
Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTS Nested Type
C++
typedef QuatTS_tpl<f32> QuatTS;
Description

always 64 bit

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTSd Nested Type
C++
typedef QuatTS_tpl<f64> QuatTSd;
Description

always 64 bit

Quat_tpl::QuatT_tpl::QuatTS_tpl::QuatTSr Nested Type
C++
typedef QuatTS_tpl<real> QuatTSr;
Description

variable float precision. depending on the target system it can be between 32, 64 or 80 bit

Quat_tpl::QuatT_tpl::* Operator (QuatT_tpl<F1> &, QuatT_tpl<F2> &)
C++
template <class F1,class F2> QuatT_tpl<F1> operator *(const QuatT_tpl<F1> & q, const QuatT_tpl<F2> & p);
Description

!

  • Implements the multiplication operator: QuatT=QuatposA*QuatposB

*

  • AxB = operation B followed by operation A.
  • A multiplication takes 31 muls and 30 adds (=61 float operations).

*

Quat_tpl::QuatT_tpl::* Operator (QuatT_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> QuatT_tpl<F1> operator *(const QuatT_tpl<F1> & p, const Quat_tpl<F2> & q);
Description

! *

  • Implements the multiplication operator: QuatT=Quatpos*Quat

*

  • AxB = operation B followed by operation A.
  • A multiplication takes 16 muls and 12 adds (=28 float operations).

*

Quat_tpl::QuatT_tpl::* Operator (QuatT_tpl<F> &, Vec3_tpl<F2> &)
C++
template <class F,class F2> Vec3_tpl<F> operator *(const QuatT_tpl<F> & q, const Vec3_tpl<F2> & v);
Description

!

  • post-multiply of a QuatT and a Vec3 (3D rotations with quaternions)

*

  • Example:
  • Quat q(1,0,0,0);
  • Vec3 v(33,44,55);
  • Vec3 result = q*v;
Quat_tpl::QuatT_tpl::CreateFromVectors Method
C++
static QuatT_tpl<F> CreateFromVectors(const Vec3_tpl<F>& vx, const Vec3_tpl<F>& vy, const Vec3_tpl<F>& vz, const Vec3_tpl<F>& pos);
Quat_tpl::QuatT_tpl::CreateNLerp Method
C++
static QuatT_tpl<F> CreateNLerp(const QuatT_tpl<F> & p, const QuatT_tpl<F> & q, F t);
Quat_tpl::QuatT_tpl::CreateRotationAA Method
C++
static QuatT_tpl<F> CreateRotationAA(F cosha, F sinha, const Vec3_tpl<F> axis, const Vec3_tpl<F>& trans = Vec3(ZERO));
Quat_tpl::QuatT_tpl::CreateRotationXYZ Method
C++
static QuatT_tpl<F> CreateRotationXYZ(const Ang3_tpl<F>& rad, const Vec3_tpl<F>& trans = Vec3(ZERO));
Quat_tpl::QuatT_tpl::DEFINE_ALIGNED_DATA Method (QuatTd, QuatTrA, 16)
C++
DEFINE_ALIGNED_DATA(QuatTd, QuatTrA, 16);
Description

typedef __declspec(align(16)) Quat_tpl

Quat_tpl::QuatT_tpl::GetColumn0 Method
C++
Vec3_tpl<F> GetColumn0() const;
Quat_tpl::QuatT_tpl::GetColumn1 Method
C++
Vec3_tpl<F> GetColumn1() const;
Quat_tpl::QuatT_tpl::GetColumn2 Method
C++
Vec3_tpl<F> GetColumn2() const;
Quat_tpl::QuatT_tpl::GetColumn3 Method
C++
Vec3_tpl<F> GetColumn3() const;
Quat_tpl::QuatT_tpl::GetInverted Method
C++
QuatT_tpl<F> GetInverted() const;
Quat_tpl::QuatT_tpl::DEFINE_ALIGNED_DATA Method (QuatT, QuatTA, 32)
C++
DEFINE_ALIGNED_DATA(QuatT, QuatTA, 32);
Description

wastest 4byte per quatT // typedef __declspec(align(16)) Quat_tpl

Quat_tpl::QuatT_tpl::GetRow0 Method
C++
Vec3_tpl<F> GetRow0() const;
Quat_tpl::QuatT_tpl::GetRow1 Method
C++
Vec3_tpl<F> GetRow1() const;
Quat_tpl::QuatT_tpl::GetRow2 Method
C++
Vec3_tpl<F> GetRow2() const;
Quat_tpl::QuatT_tpl::GetScaled Method
C++
QuatT_tpl<F> GetScaled(F scale);
Quat_tpl::QuatT_tpl::q Data Member
C++
Quat_tpl<F> q;
Description

this is the quaternion

Quat_tpl::QuatT_tpl::Invert Method
C++
void Invert();
Quat_tpl::QuatT_tpl::IsEquivalent Method
C++
static bool IsEquivalent(const QuatT_tpl<F>& qt1, const QuatT_tpl<F>& qt2, F qe = RAD_EPSILON, F ve = VEC_EPSILON);
Quat_tpl::QuatT_tpl::IsIdentity Method
C++
bool IsIdentity() const;
Quat_tpl::QuatT_tpl::IsValid Method
C++
bool IsValid() const;
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor ()
C++
QuatT_tpl();
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (DualQuat_tpl<F>&)
C++
QuatT_tpl(const DualQuat_tpl<F>& qd);
Description

convert unit DualQuat back to QuatT

Quat_tpl::QuatT_tpl::t Data Member
C++
Vec3_tpl<F> t;
Description

this is the translation vector and a scalar (for uniform scaling?)

Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (Matrix34_tpl<F>&)
C++
explicit QuatT_tpl(const Matrix34_tpl<F>& m);
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (QuatTS_tpl<F>&)
C++
explicit QuatT_tpl(const QuatTS_tpl<F>& qts);
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (QuatT_tpl<F1>&)
C++
template <typename F1> QuatT_tpl(const QuatT_tpl<F1>& qt);
Description

CONSTRUCTOR: implement the copy/casting/assignment constructor:

Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (Quat_tpl<F>&, Vec3_tpl<F>&)
C++
QuatT_tpl(const Quat_tpl<F>& quat, const Vec3_tpl<F>& trans);
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (Vec3_tpl<F>&, Quat_tpl<F>&)
C++
QuatT_tpl(const Vec3_tpl<F>& _t, const Quat_tpl<F>& _q);
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (type_identity)
C++
QuatT_tpl(type_identity);
Quat_tpl::QuatT_tpl::QuatT_tpl Constructor (type_zero)
C++
QuatT_tpl(type_zero);
Description

initialize with zeros

Quat_tpl::QuatT_tpl::SetFromVectors Method
C++
void SetFromVectors(const Vec3& vx, const Vec3& vy, const Vec3& vz, const Vec3& pos);
Notes

all vectors are stored in columns

Quat_tpl::QuatT_tpl::SetIdentity Method
C++
void SetIdentity();
Quat_tpl::QuatT_tpl::SetNLerp Method
C++
void SetNLerp(const QuatT_tpl<F> & p, const QuatT_tpl<F> & tq, F ti);
Description

!

  • linear-interpolation between quaternions (lerp)

*

  • Example:
  • CQuaternion result,p,q;
  • result=qlerp( p, q, 0.5f );
Quat_tpl::QuatT_tpl::SetRotationAA Method
C++
void SetRotationAA(F cosha, F sinha, const Vec3_tpl<F> axis, const Vec3_tpl<F>& trans = Vec3(ZERO));
Quat_tpl::QuatT_tpl::SetRotationXYZ Method
C++
void SetRotationXYZ(const Ang3_tpl<F>& rad, const Vec3_tpl<F>& trans = Vec3(ZERO));
Description

!

  • Convert three Euler angle to mat33 (rotation order:XYZ)
  • The Euler angles are assumed to be in radians.
  • The translation-vector is set to zero by default.

*

  • Example 1:
  • QuatT qp;
  • qp.SetRotationXYZ( Ang3(0.5f,0.2f,0.9f), translation );

*

Quat_tpl::QuatT_tpl::SetTranslation Method
C++
void SetTranslation(const Vec3_tpl<F>& trans);
Quat_tpl::QuatT_tpl::QuatT Nested Type
C++
typedef QuatT_tpl<f32> QuatT;
Description

always 32 bit

Quat_tpl::QuatT_tpl::QuatTd Nested Type
C++
typedef QuatT_tpl<f64> QuatTd;
Description

always 64 bit

Quat_tpl::QuatT_tpl::QuatTr Nested Type
C++
typedef QuatT_tpl<real> QuatTr;
Description

variable float precision. depending on the target system it can be between 32, 64 or bit

Quat_tpl::v Data Member
C++
Vec3_tpl<F> v;
Quat_tpl::w Data Member
C++
F w;
Quat_tpl::- Operator ()
C++
Quat_tpl<F> operator -() const;
Description

flip quaternion. don't confuse this with quaternion-inversion.

Quat_tpl::- Operator (Quat_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> Quat_tpl<F1> operator -(const Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Description

!

  • subtraction operator

*

  • Example:
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat result=p-q;

*

  • Example: (self-subtraction operator)
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat p-=q;
Quat_tpl::! Operator
C++
Quat_tpl<F> operator !() const;
Description

!

*

Quat_tpl::!= Operator
C++
bool operator !=(const Quat_tpl<F> & q) const;
Quat_tpl::% Operator
C++
template <class F1,class F2> Quat_tpl<F1> operator %(const Quat_tpl<F1> & q, const Quat_tpl<F2> & tp);
Quat_tpl::%= Operator
C++
template <class F1,class F2> void operator %=(Quat_tpl<F1> & q, const Quat_tpl<F2> & tp);
Quat_tpl::* Operator (F, Quat_tpl<F> &)
C++
template <typename F> Quat_tpl<F> operator *(F t, const Quat_tpl<F> & q);
Description

! Scale quaternion free function.

Quat_tpl::* Operator (Quat_tpl<F1> &, F2)
C++
template <typename F1,typename F2> Quat_tpl<F1> operator *(const Quat_tpl<F1> & q, F2 t);
Quat_tpl::* Operator (Quat_tpl<F1> &, QuatT_tpl<F2> &)
C++
template <class F1,class F2> QuatT_tpl<F1> operator *(const Quat_tpl<F1> & q, const QuatT_tpl<F2> & p);
Description

!

  • Implements the multiplication operator: QuatT=Quat*Quatpos

*

  • AxB = operation B followed by operation A.
  • A multiplication takes 31 muls and 27 adds (=58 float operations).

*

Quat_tpl::DEFINE_ALIGNED_DATA Method (Quat, QuatA, 16)
C++
DEFINE_ALIGNED_DATA(Quat, QuatA, 16);
Description

typedef __declspec(align(16)) Quat_tpl

Quat_tpl::* Operator (Quat_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> Quat_tpl<F1> operator *(const Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Description

! *

  • Implements the multiplication operator: Qua=QuatA*QuatB

*

  • AxB = operation B followed by operation A.
  • A multiplication takes 16 muls and 12 adds.

*

  • Example 1:
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat result=p*q;

*

  • Example 2: (self-multiplication)
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat p*=q;
Quat_tpl::* Operator (Quat_tpl<F> &, Vec3_tpl<F2> &)
C++
template <class F,class F2> Vec3_tpl<F> operator *(const Quat_tpl<F> & q, const Vec3_tpl<F2> & v);
Description

! *

  • post-multiply of a quaternion and a Vec3 (3D rotations with quaternions)

*

  • Example:
  • Quat q(1,0,0,0);
  • Vec3 v(33,44,55);
  • Vec3 result = q*v;
Quat_tpl::* Operator (Vec3_tpl<F> &, Quat_tpl<F2> &)
C++
template <class F,class F2> Vec3_tpl<F2> operator *(const Vec3_tpl<F> & v, const Quat_tpl<F2> & q);
Description

!

  • pre-multiply of a quaternion and a Vec3 (3D rotations with quaternions)

*

  • Example:
  • Quat q(1,0,0,0);
  • Vec3 v(33,44,55);
  • Vec3 result = v*q;
Quat_tpl::*= Operator (F)
C++
void operator *=(F op);
Description

multiplication by a scalar

Quat_tpl::GetColumn Method
C++
Vec3_tpl<F> GetColumn(uint32 i);
Description

A quaternion is a compressed matrix. Thus there is no problem extracting the rows & columns.

Quat_tpl::*= Operator (Quat_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> void operator *=(Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Quat_tpl::/ Operator (Quat_tpl<F1> &, F2)
C++
template <typename F1,typename F2> Quat_tpl<F1> operator /(const Quat_tpl<F1> & q, F2 t);
Quat_tpl::/ Operator (Quat_tpl<F1> &, Quat_tpl<F2> &)
C++
template <class F1,class F2> Quat_tpl<F1> operator /(const Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Description

!

  • division operator

*

  • Example 1:
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat result=p/q;

*

  • Example 2: (self-division)
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat p/=q;
Quat_tpl::/= Operator
C++
template <class F1,class F2> void operator /=(Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Quat_tpl::| Operator
C++
template <typename F1,typename F2> F1 operator |(const Quat_tpl<F1>& q, const Quat_tpl<F2>& p);
Description

! *

  • The "inner product" or "dot product" operation.

*

  • calculate the "inner product" between two Quaternion.
  • If both Quaternion are unit-quaternions, the result is the cosine: p*q=cos(angle)

*

  • Example:
  • Quat p(1,0,0,0),q(1,0,0,0);
  • f32 cosine = ( p | q );
Quat_tpl::+ Operator
C++
template <class F1,class F2> Quat_tpl<F1> operator +(const Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Description

!

  • addition operator

*

  • Example:
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat result=p+q;

*

  • Example:(self-addition operator)
  • Quat p(1,0,0,0),q(1,0,0,0);
  • Quat p-=q;
Quat_tpl::+= Operator
C++
template <class F1,class F2> void operator +=(Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Quat_tpl::= Operator
C++
Quat_tpl<F>& operator =(const Quat_tpl<F> & src);
Description

ASSIGNMENT OPERATOR of identical Quat types. The assignment operator has precedence over assignment constructor Quat q; q=q0;

Quat_tpl::-= Operator
C++
template <class F1,class F2> void operator -=(Quat_tpl<F1> & q, const Quat_tpl<F2> & p);
Quat_tpl::== Operator
C++
bool operator ==(const Quat_tpl<F> & q) const;
Description

Exact compare of 2 quats.

Quat_tpl::CreateExpSlerp Method
C++
static Quat_tpl<F> CreateExpSlerp(const Quat_tpl<F> & p, const Quat_tpl<F> & q, F t);
Quat_tpl::CreateIdentity Method
C++
static Quat_tpl<F> CreateIdentity();
Quat_tpl::CreateNlerp Method
C++
static Quat_tpl<F> CreateNlerp(const Quat_tpl<F> & p, const Quat_tpl<F> & tq, F t);
Quat_tpl::CreateNlerpCubic Method
C++
static Quat_tpl<F> CreateNlerpCubic(const Quat_tpl<F> & p, const Quat_tpl<F> & tq, F t);
Quat_tpl::CreateRotationAA Method (F, F, Vec3_tpl<F> &)
C++
static Quat_tpl<F> CreateRotationAA(F cosha, F sinha, const Vec3_tpl<F> & axis);
Quat_tpl::CreateRotationAA Method (F, Vec3_tpl<F> &)
C++
static Quat_tpl<F> CreateRotationAA(F rad, const Vec3_tpl<F> & axis);
Quat_tpl::CreateRotationV0V1 Method
C++
static Quat_tpl<F> CreateRotationV0V1(const Vec3_tpl<F>& v0, const Vec3_tpl<F>& v1);
Quat_tpl::CreateRotationVDir Method (Vec3_tpl<F>&)
C++
static Quat_tpl<F> CreateRotationVDir(const Vec3_tpl<F>& vdir);
Quat_tpl::CreateRotationVDir Method (Vec3_tpl<F>&, F)
C++
static Quat_tpl<F> CreateRotationVDir(const Vec3_tpl<F>& vdir, F roll);
Quat_tpl::CreateRotationX Method
C++
static Quat_tpl<F> CreateRotationX(f32 r);
Quat_tpl::CreateRotationXYZ Method
C++
static Quat_tpl<F> CreateRotationXYZ(const Ang3_tpl<F> & a);
Quat_tpl::CreateRotationY Method
C++
static Quat_tpl<F> CreateRotationY(f32 r);
Quat_tpl::CreateRotationZ Method
C++
static Quat_tpl<F> CreateRotationZ(f32 r);
Quat_tpl::CreateSlerp Method
C++
static Quat_tpl<F> CreateSlerp(const Quat_tpl<F> & p, const Quat_tpl<F> & tq, F t);
Quat_tpl::CreateSquad Method
C++
static Quat_tpl<F> CreateSquad(const Quat_tpl<F>& p, const Quat_tpl<F>& a, const Quat_tpl<F>& b, const Quat_tpl<F>& q, F t);
Quat_tpl::DEFINE_ALIGNED_DATA Method (Quatd, QuatrA, 32)
C++
DEFINE_ALIGNED_DATA(Quatd, QuatrA, 32);
Description

typedef __declspec(align(16)) Quat_tpl

Quat_tpl::exp Method
C++
static Quat_tpl<F> exp(const Vec3_tpl<F>& v);
Description

Exponent of Quaternion.

Quat_tpl::GetColumn0 Method
C++
Vec3_tpl<F> GetColumn0() const;
Quat_tpl::GetColumn1 Method
C++
Vec3_tpl<F> GetColumn1() const;
Quat_tpl::GetColumn2 Method
C++
Vec3_tpl<F> GetColumn2() const;
Quat_tpl::GetFwdX Method
C++
F GetFwdX() const;
Description

These are just copy & pasted components of the GetColumn1() above.

Quat_tpl::GetFwdY Method
C++
F GetFwdY() const;
Quat_tpl::GetFwdZ Method
C++
F GetFwdZ() const;
Quat_tpl::GetInverted Method
C++
Quat_tpl<F> GetInverted() const;
Quat_tpl::GetLength Method
C++
F GetLength() const;
Description

!

*

  • Example 1:
  • f32 l=q.GetLength();
Quat_tpl::GetNormalized Method
C++
Quat_tpl<F> GetNormalized() const;
Quat_tpl::GetNormalizedFast Method
C++
Quat_tpl<F> GetNormalizedFast() const;
Quat_tpl::GetNormalizedSafe Method
C++
Quat_tpl<F> GetNormalizedSafe() const;
Quat_tpl::GetRotZ Method
C++
F GetRotZ() const;
Quat_tpl::GetRow0 Method
C++
Vec3_tpl<F> GetRow0() const;
Quat_tpl::GetRow1 Method
C++
Vec3_tpl<F> GetRow1() const;
Quat_tpl::GetRow2 Method
C++
Vec3_tpl<F> GetRow2() const;
Quat_tpl::GetScaled Method
C++
Quat_tpl<F> GetScaled(F scale) const;
Description

useless, please delete

Quat_tpl::Invert Method
C++
void Invert();
Quat_tpl::IsEquivalent Method
C++
static bool IsEquivalent(const Quat_tpl<F>& q1, const Quat_tpl<F>& q2, F qe = RAD_EPSILON);
Quat_tpl::IsIdentity Method
C++
bool IsIdentity() const;
Description

Check if identity quaternion.

Quat_tpl::IsUnit Method
C++
bool IsUnit(F e = VEC_EPSILON) const;
Quat_tpl::IsValid Method
C++
bool IsValid(F e = VEC_EPSILON) const;
Quat_tpl::LnDif Method
C++
static Quat_tpl<F> LnDif(const Quat_tpl<F>& q1, const Quat_tpl<F>& q2);
Description

! Logarithm of Quaternion difference.

Quat_tpl::log Method
C++
static Vec3_tpl<F> log(const Quat_tpl<F>& q);
Description

logarithm of a quaternion, imaginary part (the real part of the logarithm is always 0)

Quat_tpl::Normalize Method
C++
void Normalize();
Description

!

*

  • Example 1:
  • Quat q; q.Normalize();

*

Quat_tpl::NormalizeFast Method
C++
void NormalizeFast();
Quat_tpl::NormalizeSafe Method
C++
void NormalizeSafe();
Quat_tpl::Quat_tpl Constructor ()
C++
Quat_tpl();
Quat_tpl::Quat_tpl Constructor (Ang3_tpl<F1>&)
C++
template <class F1>  explicit Quat_tpl<F>(const Ang3_tpl<F1>& ang);
Description

CONSTRUCTOR for different types. It converts a Euler Angle into a Quat and converts between double/float. . Needs to be 'explicit' because we loose fp-precision in the conversion process Quat(Ang3r(1,2,3));

Quat_tpl::Quat_tpl Constructor (Ang3_tpl<F>&)
C++
explicit Quat_tpl<F>(const Ang3_tpl<F>& ang);
Description

CONSTRUCTOR for different types. It converts a Euler Angle into a Quat. Needs to be 'explicit' because we loose fp-precision in the conversion process Quat(Ang3(1,2,3));

Quat_tpl::Quat_tpl Constructor (F, F, F, F)
C++
Quat_tpl<F>(F qw, F qx, F qy, F qz);
Description

CONSTRUCTOR to initialize a Quat from 4 floats Quat q(1,0,0,0);

Quat_tpl::Quat_tpl Constructor (F, Vec3_tpl<F> &)
C++
Quat_tpl<F>(F scalar, const Vec3_tpl<F> & vector);
Description

CONSTRUCTOR to initialize a Quat with a scalar and a vector Quat q(1,Vec3(0,0,0));

Quat_tpl::Quat_tpl Constructor (Matrix33_tpl<F1>&)
C++
template <class F1>  explicit Quat_tpl<F>(const Matrix33_tpl<F1>& m);
Description

CONSTRUCTOR for different types. It converts a Matrix33 into a Quat and converts between double/float. Needs to be 'explicit' because we loose fp-precision the conversion process Quat(m33r); Quatr(m33);

Quat_tpl::Quat_tpl Constructor (Matrix33_tpl<F>&)
C++
explicit Quat_tpl<F>(const Matrix33_tpl<F>& m);
Description

CONSTRUCTOR for different types. It converts a Matrix33 into a Quat. Needs to be 'explicit' because we loose fp-precision in the conversion process Quat(m33);

Quat_tpl::Quat_tpl Constructor (Matrix34_tpl<F1>&)
C++
template <class F1>  explicit Quat_tpl<F>(const Matrix34_tpl<F1>& m);
Description

CONSTRUCTOR for different types. It converts a Matrix34 into a Quat and converts between double/float. Needs to be 'explicit' because we loose fp-precision the conversion process Quat(m34r); Quatr(m34);

Quat_tpl::Quat_tpl Constructor (Matrix34_tpl<F>&)
C++
explicit Quat_tpl<F>(const Matrix34_tpl<F>& m);
Description

CONSTRUCTOR for different types. It converts a Matrix34 into a Quat. Needs to be 'explicit' because we loose fp-precision in the conversion process Quat(m34);

Quat_tpl::Quat_tpl Constructor (Quat_tpl<F1>&)
C++
template <class F1> Quat_tpl<F>(const Quat_tpl<F1>& q);
Description

CONSTRUCTOR for identical types which converts between double/float Quat q32=q64; Quatr q64=q32;

Quat_tpl::Quat_tpl Constructor (Quat_tpl<F>&)
C++
Quat_tpl<F>(const Quat_tpl<F>& q);
Description

CONSTRUCTOR for identical types Quat q=q0;

Quat_tpl::Quat_tpl Constructor (type_identity)
C++
Quat_tpl(type_identity);
Quat_tpl::Quat_tpl Constructor (type_zero)
C++
Quat_tpl(type_zero);
Description

initialize with zeros

Quat_tpl::SetExpSlerp Method
C++
void SetExpSlerp(const Quat_tpl<F> & p, const Quat_tpl<F> & tq, F t);
Description

!

  • spherical-interpolation between quaternions (algebraic slerp_a)
  • I have included this function just for the sake of completeness, because
  • its the only useful application to check if exp & log really work.
  • Both slerp-functions are returning the same result.

*

  • Example:
  • Quat result,p,q;
  • result.SetExpSlerp( p,q,0.3345f );
Quat_tpl::SetIdentity Method
C++
void SetIdentity();
Description

!

*

Quat_tpl::SetNlerp Method
C++
void SetNlerp(const Quat_tpl<F> & p, const Quat_tpl<F> & tq, F t);
Description

!

  • linear-interpolation between quaternions (lerp)

*

  • Example:
  • CQuaternion result,p,q;
  • result=qlerp( p, q, 0.5f );
Quat_tpl::SetNlerpCubic Method
C++
void SetNlerpCubic(const Quat_tpl<F> & p, const Quat_tpl<F> & tq, F t);
Description

!

  • linear-interpolation between quaternions (nlerp)
  • in this case we convert the t-value into a 1d cubic spline to get closer to Slerp

*

  • Example:
  • Quat result,p,q;
  • result.SetNlerpCubic( p, q, 0.5f );
Quat_tpl::SetRotationAA Method (F, F, Vec3_tpl<F> &)
C++
void SetRotationAA(F cosha, F sinha, const Vec3_tpl<F> & axis);
Quat_tpl::SetRotationAA Method (F, Vec3_tpl<F> &)
C++
void SetRotationAA(F rad, const Vec3_tpl<F> & axis);
Quat_tpl::SetRotationV0V1 Method
C++
void SetRotationV0V1(const Vec3_tpl<F>& v0, const Vec3_tpl<F>& v1);
Description

! *

  • Create rotation-quaternion that rotates from one vector to another.
  • Both vectors are assumed to be normalized.

*

Quat_tpl::SetRotationVDir Method (Vec3_tpl<F>&)
C++
void SetRotationVDir(const Vec3_tpl<F>& vdir);
Description

! *

  • param vdir normalized view direction.
  • param roll radiant to rotate about Y-axis.

*

  • Given a view-direction and a radiant to rotate about Y-axis, this function builds a 3x3 look-at quaternion
  • using only simple vector arithmetic. This function is always using the implicit up-vector Vec3(0,0,1).
  • The view-direction is always stored in column(1).
  • IMPORTANT: The view-vector is assumed to be normalized, because all trig-values for the orientation are being
  • extracted directly out of the vector. This function must NOT be called with a view-direction
  • that is close to Vec3(0,0,1) or Vec3(0,0,-1). If one of these rules is broken, the function returns a quaternion
  • with an undefined rotation about the Z-axis.

*

  • Rotation order for the look-at-quaternion is Z-X-Y. (Zaxis=YAW / Xaxis=PITCH / Yaxis=ROLL)

*

  • COORDINATE-SYSTEM

*

  • z-axis
  • ^
  • |
  • | y-axis
  • | /
  • | /
  • |/
  • +---------------> x-axis

*

Quat_tpl::SetRotationVDir Method (Vec3_tpl<F>&, F)
C++
void SetRotationVDir(const Vec3_tpl<F>& vdir, F r);
Quat_tpl::SetRotationX Method
C++
void SetRotationX(f32 r);
Description

!

  • Create rotation-quaternion that about the x-axis.

*

Quat_tpl::SetRotationXYZ Method
C++
void SetRotationXYZ(const Ang3_tpl<F> & a);
Description

!

  • Create rotation-quaternion that around the fixed coordinate axes.

*

Quat_tpl::SetRotationY Method
C++
void SetRotationY(f32 r);
Description

!

  • Create rotation-quaternion that about the y-axis.

*

Quat_tpl::SetRotationZ Method
C++
void SetRotationZ(f32 r);
Description

!

  • Create rotation-quaternion that about the z-axis.

*

Quat_tpl::SetSlerp Method
C++
void SetSlerp(const Quat_tpl<F> & tp, const Quat_tpl<F> & tq, F t);
Description

!

  • spherical-interpolation between quaternions (geometrical slerp)

*

  • Example:
  • Quat result,p,q;
  • result.SetSlerp( p, q, 0.5f );
Quat_tpl::SetSquad Method
C++
void SetSquad(const Quat_tpl<F>& p, const Quat_tpl<F>& a, const Quat_tpl<F>& b, const Quat_tpl<F>& q, F t);
Description

! squad(p,a,b,q,t) = slerp( slerp(p,q,t),slerp(a,b,t), 2(1-t)t).

Quat_tpl::CryQuat Nested Type
C++
typedef Quat_tpl<f32> CryQuat;
Quat_tpl::Quat Nested Type
C++
typedef Quat_tpl<f32> Quat;
Description

always 32 bit

Quat_tpl::Quatd Nested Type
C++
typedef Quat_tpl<f64> Quatd;
Description

always 64 bit

Quat_tpl::quaternion Nested Type
C++
typedef Quat_tpl<real> quaternion;
Quat_tpl::quaternionf Nested Type
C++
typedef Quat_tpl<f32> quaternionf;
Quat_tpl::Quatr Nested Type
C++
typedef Quat_tpl<real> Quatr;
Description

variable float precision. depending on the target system it can be between 32, 64 or 80 bit

In This Topic

  • No labels