voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Friends | List of all members
blub::quaternion Class Reference

Public Member Functions

 quaternion (real fX, real fY, real fZ, real fW)
 Construct from an explicit list of values.
 
 quaternion (const real &rfAngle, const vector3 &rkAxis)
 
 quaternion (const Ogre::Quaternion &quat)
 
 operator Ogre::Quaternion () const
 
 quaternion (const btQuaternion &quat)
 
 operator btQuaternion () const
 
void swap (quaternion &other)
 
real operator[] (const size_t i) const
 Array accessor operator.
 
real & operator[] (const size_t i)
 Array accessor operator.
 
real * ptr ()
 Pointer accessor for direct copying.
 
const real * ptr () const
 Pointer accessor for direct copying.
 
quaternion operator+ (const quaternion &rkQ) const
 
quaternion operator- (const quaternion &rkQ) const
 
quaternion operator* (const quaternion &rkQ) const
 
quaternion operator* (real fScalar) const
 
vector3 operator* (const vector3 &rkVector) const
 
quaternion operator- () const
 
bool operator== (const quaternion &rhs) const
 
bool operator!= (const quaternion &rhs) const
 
real Dot (const quaternion &rkQ) const
 
real Norm () const
 
real normalise ()
 
quaternion getNormalised () const
 
quaternion Inverse () const
 
quaternion UnitInverse () const
 
quaternion Exp () const
 
quaternion Log () const
 
void FromAngleAxis (const real &rfAngle, const vector3 &rkAxis)
 

Static Public Member Functions

static quaternion Slerp (real fT, const quaternion &rkP, const quaternion &rkQ, bool shortestPath=false)
 
static quaternion SlerpExtraSpins (real fT, const quaternion &rkP, const quaternion &rkQ, int iExtraSpins)
 
static void Intermediate (const quaternion &rkQ0, const quaternion &rkQ1, const quaternion &rkQ2, quaternion &rkA, quaternion &rkB)
 
static quaternion Squad (real fT, const quaternion &rkP, const quaternion &rkA, const quaternion &rkB, const quaternion &rkQ, bool shortestPath=false)
 
static quaternion nlerp (real fT, const quaternion &rkP, const quaternion &rkQ, bool shortestPath=false)
 

Public Attributes

real w
 
real x
 
real y
 
real z
 

Static Public Attributes

static const quaternion ZERO = quaternion(0., 0., 0., 0.)
 
static const quaternion IDENTITY = quaternion(0., 0., 0., 1.)
 

Protected Member Functions

template<typename Archive >
BLUB_SERIALIZATION_ACCESS void serialize (Archive &readWrite, const unsigned int version)
 

Friends

quaternion operator* (real fScalar, const quaternion &rkQ)
 

Detailed Description

Examples:
customVertexInformation.cpp, mesh.cpp, and primitives.cpp.

Member Function Documentation

quaternion quaternion::nlerp ( real  fT,
const quaternion rkP,
const quaternion rkQ,
bool  shortestPath = false 
)
static

Performs Normalised linear interpolation between two quaternions, and returns the result. nlerp ( 0.0f, A, B ) = A nlerp ( 1.0f, A, B ) = B

Remarks
Nlerp is faster than Slerp. Nlerp has the proprieties of being commutative (
See also
Slerp; commutativity is desired in certain places, like IK animation), and being torque-minimal (unless shortestPath=false). However, it's performing the interpolation at non-constant velocity; sometimes this is desired, sometimes it is not. Having a non-constant velocity can produce a more natural rotation feeling without the need of tweaking the weights; however if your scene relies on the timing of the rotation or assumes it will point at a specific angle at a specific weight value, Slerp is a better choice.
quaternion quaternion::SlerpExtraSpins ( real  fT,
const quaternion rkP,
const quaternion rkQ,
int  iExtraSpins 
)
static
See also
Slerp. It adds extra "spins" (i.e. rotates several times) specified by parameter 'iExtraSpins' while interpolating before arriving to the final values
void quaternion::swap ( blub::quaternion other)
inline

Exchange the contents of this quaternion with another.


The documentation for this class was generated from the following files: