QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Quaternion functions

Macros

#define QDotProduct(a, b)
 
#define QuatAdd(a, b, c)
 
#define QuatBlend(q1, q2, b, q)
 
#define QuatCompare(x, y)   QuatCompCompare (x, ==, y)
 
#define QuatCompBound(a, b, c, d)
 
#define QuatCompCompare(x, op, y)
 
#define QuatCompDiv(a, b, c)
 
#define QuatCompMax(a, b, c)
 
#define QuatCompMin(a, b, c)
 
#define QuatCompMult(a, b, c)
 
#define QuatConj(a, b)
 
#define QuatCopy(a, b)
 
#define QuatExpand(q)   (q)[0], (q)[1], (q)[2], (q)[3]
 
#define QuatIsZero(a)   (!(a)[0] && !(a)[1] && !(a)[2] && !(a)[3])
 
#define QuatLength(a)   sqrt(QDotProduct(a, a))
 
#define QuatMultAdd(a, s, b, c)
 
#define QuatMultSub(a, s, b, c)
 
#define QuatNegate(a, b)
 
#define QuatScale(a, b, c)
 
#define QuatSet(a, b, c, d, e)
 
#define QuatSubtract(a, b, c)
 
#define QuatZero(a)   ((a)[3] = (a)[2] = (a)[1] = (a)[0] = 0);
 

Functions

void QuatExp (const quat_t a, quat_t b)
 
void QuatInverse (const quat_t in, quat_t out)
 
void QuatMult (const quat_t q1, const quat_t q2, quat_t out)
 
void QuatMultVec (const quat_t q, const vec3_t v, vec3_t out)
 
void QuatToMatrix (const quat_t q, vec_t *m, int homogenous, int vertical)
 

Variables

const vec_t *const quat_origin
 

Detailed Description

Macro Definition Documentation

#define QDotProduct (   a,
 
)
Value:
((a)[0] * (b)[0] + (a)[1] * (b)[1] \
+ (a)[2] * (b)[2] + (a)[3] * (b)[3])
#define QuatAdd (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] + (b)[0]; \
(c)[1] = (a)[1] + (b)[1]; \
(c)[2] = (a)[2] + (b)[2]; \
(c)[3] = (a)[3] + (b)[3]; \
} while (0)
#define QuatBlend (   q1,
  q2,
  b,
 
)
Value:
do { \
(q)[0] = (q1)[0] * (1 - (b)) + (q2)[0] * (b); \
(q)[1] = (q1)[1] * (1 - (b)) + (q2)[1] * (b); \
(q)[2] = (q1)[2] * (1 - (b)) + (q2)[2] * (b); \
(q)[3] = (q1)[3] * (1 - (b)) + (q2)[3] * (b); \
} while (0)
#define QuatCompare (   x,
 
)    QuatCompCompare (x, ==, y)
#define QuatCompBound (   a,
  b,
  c,
 
)
Value:
do { \
(d)[0] = bound ((a)[0], (b)[0], (c)[0]); \
(d)[1] = bound ((a)[1], (b)[1], (c)[1]); \
(d)[2] = bound ((a)[2], (b)[2], (c)[2]); \
(d)[3] = bound ((a)[3], (b)[3], (c)[3]); \
} while (0)
#define bound(a, b, c)
Definition: mathlib.h:46
#define QuatCompCompare (   x,
  op,
 
)
Value:
(((x)[0] op (y)[0]) && ((x)[1] op (y)[1]) \
&& ((x)[2] op (y)[2]) && ((x)[3] op (y)[3]))
vec_t * x
Definition: test-bary.c:27
int op
Definition: net_main.c:437
#define QuatCompDiv (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] / (b)[0]; \
(c)[1] = (a)[1] / (b)[1]; \
(c)[2] = (a)[2] / (b)[2]; \
(c)[3] = (a)[3] / (b)[3]; \
} while (0)
#define QuatCompMax (   a,
  b,
 
)
Value:
do { \
(c)[0] = max ((a)[0], (b)[0]); \
(c)[1] = max ((a)[1], (b)[1]); \
(c)[2] = max ((a)[2], (b)[2]); \
(c)[3] = max ((a)[3], (b)[3]); \
} while (0)
#define max(a, b)
Definition: mathlib.h:40
#define QuatCompMin (   a,
  b,
 
)
Value:
do { \
(c)[0] = min ((a)[0], (b)[0]); \
(c)[1] = min ((a)[1], (b)[1]); \
(c)[2] = min ((a)[2], (b)[2]); \
(c)[3] = min ((a)[3], (b)[3]); \
} while (0)
#define min(a, b)
Definition: mathlib.h:43
#define QuatCompMult (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] * (b)[0]; \
(c)[1] = (a)[1] * (b)[1]; \
(c)[2] = (a)[2] * (b)[2]; \
(c)[3] = (a)[3] * (b)[3]; \
} while (0)
#define QuatConj (   a,
 
)
Value:
do { \
(b)[0] = (a)[0]; \
(b)[1] = -(a)[1]; \
(b)[2] = -(a)[2]; \
(b)[3] = -(a)[3]; \
} while (0)
#define QuatCopy (   a,
 
)
Value:
do { \
(b)[0] = (a)[0]; \
(b)[1] = (a)[1]; \
(b)[2] = (a)[2]; \
(b)[3] = (a)[3]; \
} while (0)
#define QuatExpand (   q)    (q)[0], (q)[1], (q)[2], (q)[3]
#define QuatIsZero (   a)    (!(a)[0] && !(a)[1] && !(a)[2] && !(a)[3])
#define QuatLength (   a)    sqrt(QDotProduct(a, a))
#define QuatMultAdd (   a,
  s,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] + (s) * (b)[0]; \
(c)[1] = (a)[1] + (s) * (b)[1]; \
(c)[2] = (a)[2] + (s) * (b)[2]; \
(c)[3] = (a)[3] + (s) * (b)[3]; \
} while (0)
#define QuatMultSub (   a,
  s,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] - (s) * (b)[0]; \
(c)[1] = (a)[1] - (s) * (b)[1]; \
(c)[2] = (a)[2] - (s) * (b)[2]; \
(c)[3] = (a)[3] - (s) * (b)[3]; \
} while (0)
#define QuatNegate (   a,
 
)
Value:
do { \
(b)[0] = -(a)[0]; \
(b)[1] = -(a)[1]; \
(b)[2] = -(a)[2]; \
(b)[3] = -(a)[3]; \
} while (0)
#define QuatScale (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] * (b); \
(c)[1] = (a)[1] * (b); \
(c)[2] = (a)[2] * (b); \
(c)[3] = (a)[3] * (b); \
} while (0)
#define QuatSet (   a,
  b,
  c,
  d,
  e 
)
Value:
do { \
(e)[0] = a; \
(e)[1] = b; \
(e)[2] = c; \
(e)[3] = d; \
} while (0)
vrect_t e
Definition: test-vrect.c:54
#define QuatSubtract (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] - (b)[0]; \
(c)[1] = (a)[1] - (b)[1]; \
(c)[2] = (a)[2] - (b)[2]; \
(c)[3] = (a)[3] - (b)[3]; \
} while (0)
#define QuatZero (   a)    ((a)[3] = (a)[2] = (a)[1] = (a)[0] = 0);

Function Documentation

void QuatExp ( const quat_t  a,
quat_t  b 
)
void QuatInverse ( const quat_t  in,
quat_t  out 
)
void QuatMult ( const quat_t  q1,
const quat_t  q2,
quat_t  out 
)
void QuatMultVec ( const quat_t  q,
const vec3_t  v,
vec3_t  out 
)
void QuatToMatrix ( const quat_t  q,
vec_t m,
int  homogenous,
int  vertical 
)

Variable Documentation

const vec_t* const quat_origin