Functions
rs_quaternion.rsh File Reference

Functions

static void rsQuaternionSet (rs_quaternion *q, float w, float x, float y, float z)
static void rsQuaternionSet (rs_quaternion *q, const rs_quaternion *rhs)
static void rsQuaternionMultiply (rs_quaternion *q, float s)
static void rsQuaternionAdd (rs_quaternion *q, const rs_quaternion *rhs)
static void rsQuaternionLoadRotateUnit (rs_quaternion *q, float rot, float x, float y, float z)
static void rsQuaternionLoadRotate (rs_quaternion *q, float rot, float x, float y, float z)
static void rsQuaternionConjugate (rs_quaternion *q)
static float rsQuaternionDot (const rs_quaternion *q0, const rs_quaternion *q1)
static void rsQuaternionNormalize (rs_quaternion *q)
static void rsQuaternionMultiply (rs_quaternion *q, const rs_quaternion *rhs)
static void rsQuaternionSlerp (rs_quaternion *q, const rs_quaternion *q0, const rs_quaternion *q1, float t)
static void rsQuaternionGetMatrixUnit (rs_matrix4x4 *m, const rs_quaternion *q)

Detailed Description

Quaternion routines.

Definition in file rs_quaternion.rsh.


Function Documentation

static void rsQuaternionAdd ( rs_quaternion q,
const rs_quaternion rhs 
) [static]

Add two quaternions

Parameters:
qdestination quaternion to add to
rshright hand side quaternion to add

Definition at line 74 of file rs_quaternion.rsh.

static void rsQuaternionConjugate ( rs_quaternion q) [static]

Conjugates the quaternion

Parameters:
qquaternion to conjugate

Definition at line 127 of file rs_quaternion.rsh.

static float rsQuaternionDot ( const rs_quaternion q0,
const rs_quaternion q1 
) [static]

Dot product of two quaternions

Parameters:
q0first quaternion
q1second quaternion
Returns:
dot product between q0 and q1

Definition at line 140 of file rs_quaternion.rsh.

static void rsQuaternionGetMatrixUnit ( rs_matrix4x4 m,
const rs_quaternion q 
) [static]

Computes rotation matrix from the normalized quaternion

Parameters:
mresulting matrix
pnormalized quaternion

Definition at line 228 of file rs_quaternion.rsh.

static void rsQuaternionLoadRotate ( rs_quaternion q,
float  rot,
float  x,
float  y,
float  z 
) [static]

Loads a quaternion that represents a rotation about an arbitrary vector (doesn't have to be unit)

Parameters:
qquaternion to set
rotangle to rotate by
xcomponent of a vector
ycomponent of a vector
xcomponent of a vector

Definition at line 111 of file rs_quaternion.rsh.

static void rsQuaternionLoadRotateUnit ( rs_quaternion q,
float  rot,
float  x,
float  y,
float  z 
) [static]

Loads a quaternion that represents a rotation about an arbitrary unit vector

Parameters:
qquaternion to set
rotangle to rotate by
xcomponent of a vector
ycomponent of a vector
xcomponent of a vector

Definition at line 90 of file rs_quaternion.rsh.

static void rsQuaternionMultiply ( rs_quaternion q,
float  s 
) [static]

Multiply quaternion by a scalar

Parameters:
qquaternion to multiply
sscalar

Definition at line 61 of file rs_quaternion.rsh.

static void rsQuaternionMultiply ( rs_quaternion q,
const rs_quaternion rhs 
) [static]

Multiply quaternion by another quaternion

Parameters:
qdestination quaternion
rhsright hand side quaternion to multiply by

Definition at line 163 of file rs_quaternion.rsh.

static void rsQuaternionNormalize ( rs_quaternion q) [static]

Normalizes the quaternion

Parameters:
qquaternion to normalize

Definition at line 149 of file rs_quaternion.rsh.

static void rsQuaternionSet ( rs_quaternion q,
float  w,
float  x,
float  y,
float  z 
) [static]

Set the quaternion components

Parameters:
wcomponent
xcomponent
ycomponent
zcomponent

Definition at line 35 of file rs_quaternion.rsh.

static void rsQuaternionSet ( rs_quaternion q,
const rs_quaternion rhs 
) [static]

Set the quaternion from another quaternion

Parameters:
qdestination quaternion
rhssource quaternion

Definition at line 48 of file rs_quaternion.rsh.

static void rsQuaternionSlerp ( rs_quaternion q,
const rs_quaternion q0,
const rs_quaternion q1,
float  t 
) [static]

Performs spherical linear interpolation between two quaternions

Parameters:
qresult quaternion from interpolation
q0first param
q1second param
thow much to interpolate by

Definition at line 182 of file rs_quaternion.rsh.