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

Macros

#define DotProduct(a, b)   ((a)[0] * (b)[0] + (a)[1] * (b)[1] + (a)[2] * (b)[2])
 
#define VectorAdd(a, b, c)
 
#define VectorBlend(v1, v2, b, v)
 
#define VectorCompare(x, y)   VectorCompCompare (x, ==, y)
 
#define VectorCompBound(a, b, c, d)
 
#define VectorCompCompare(x, op, y)   (((x)[0] op (y)[0]) && ((x)[1] op (y)[1]) && ((x)[2] op (y)[2]))
 
#define VectorCompDiv(a, b, c)
 
#define VectorCompMax(a, b, c)
 
#define VectorCompMin(a, b, c)
 
#define VectorCompMult(a, b, c)
 
#define VectorCopy(a, b)
 
#define VectorDistance(a, b)   sqrt(VectorDistance_fast(a, b))
 
#define VectorDistance_fast(a, b)
 
#define VectorExpand(v)   (v)[0], (v)[1], (v)[2]
 
#define VectorIsZero(a)   (!(a)[0] && !(a)[1] && !(a)[2])
 
#define VectorLength(a)   sqrt(DotProduct(a, a))
 
#define VectorMultAdd(a, s, b, c)
 
#define VectorMultSub(a, s, b, c)
 
#define VectorNegate(a, b)
 
#define VectorScale(a, b, c)
 
#define VectorSet(a, b, c, d)
 
#define VectorShear(a, b, c)
 Shear vector b by vector a. More...
 
#define VectorSubtract(a, b, c)
 
#define VectorUnshear(a, b, c)
 
#define VectorZero(a)   ((a)[2] = (a)[1] = (a)[0] = 0);
 

Functions

vec_t _DotProduct (const vec3_t v1, const vec3_t v2)
 
void _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out)
 
int _VectorCompare (const vec3_t v1, const vec3_t v2)
 
void _VectorCopy (const vec3_t in, vec3_t out)
 
vec_t _VectorLength (const vec3_t v)
 
void _VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc)
 
vec_t _VectorNormalize (vec3_t v)
 
void _VectorScale (const vec3_t in, vec_t scale, vec3_t out)
 
void _VectorSubtract (const vec3_t veca, const vec3_t vecb, vec3_t out)
 
void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross)
 
float VectorNormalize (vec3_t v)
 

Variables

const vec_t *const vec3_origin
 

Detailed Description

Macro Definition Documentation

#define DotProduct (   a,
 
)    ((a)[0] * (b)[0] + (a)[1] * (b)[1] + (a)[2] * (b)[2])
#define VectorAdd (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] + (b)[0]; \
(c)[1] = (a)[1] + (b)[1]; \
(c)[2] = (a)[2] + (b)[2]; \
} while (0)
#define VectorBlend (   v1,
  v2,
  b,
 
)
Value:
do { \
(v)[0] = (v1)[0] * (1 - (b)) + (v2)[0] * (b); \
(v)[1] = (v1)[1] * (1 - (b)) + (v2)[1] * (b); \
(v)[2] = (v1)[2] * (1 - (b)) + (v2)[2] * (b); \
} while (0)
#define VectorCompare (   x,
 
)    VectorCompCompare (x, ==, y)
#define VectorCompBound (   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]); \
} while (0)
#define bound(a, b, c)
Definition: mathlib.h:46
#define VectorCompCompare (   x,
  op,
 
)    (((x)[0] op (y)[0]) && ((x)[1] op (y)[1]) && ((x)[2] op (y)[2]))
#define VectorCompDiv (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] / (b)[0]; \
(c)[1] = (a)[1] / (b)[1]; \
(c)[2] = (a)[2] / (b)[2]; \
} while (0)
#define VectorCompMax (   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]); \
} while (0)
#define max(a, b)
Definition: mathlib.h:40
#define VectorCompMin (   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]); \
} while (0)
#define min(a, b)
Definition: mathlib.h:43
#define VectorCompMult (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] * (b)[0]; \
(c)[1] = (a)[1] * (b)[1]; \
(c)[2] = (a)[2] * (b)[2]; \
} while (0)
#define VectorCopy (   a,
 
)
Value:
do { \
(b)[0] = (a)[0]; \
(b)[1] = (a)[1]; \
(b)[2] = (a)[2]; \
} while (0)
#define VectorDistance (   a,
 
)    sqrt(VectorDistance_fast(a, b))
#define VectorDistance_fast (   a,
 
)
Value:
((((a)[0] - (b)[0]) * ((a)[0] - (b)[0])) + \
(((a)[1] - (b)[1]) * ((a)[1] - (b)[1])) + \
(((a)[2] - (b)[2]) * ((a)[2] - (b)[2])))
#define VectorExpand (   v)    (v)[0], (v)[1], (v)[2]
#define VectorIsZero (   a)    (!(a)[0] && !(a)[1] && !(a)[2])
#define VectorLength (   a)    sqrt(DotProduct(a, a))
#define VectorMultAdd (   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]; \
} while (0)
#define VectorMultSub (   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]; \
} while (0)
#define VectorNegate (   a,
 
)
Value:
do { \
(b)[0] = -(a)[0]; \
(b)[1] = -(a)[1]; \
(b)[2] = -(a)[2]; \
} while (0)
#define VectorScale (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] * (b); \
(c)[1] = (a)[1] * (b); \
(c)[2] = (a)[2] * (b); \
} while (0)
#define VectorSet (   a,
  b,
  c,
 
)
Value:
do { \
(d)[0] = a; \
(d)[1] = b; \
(d)[2] = c; \
} while (0)
#define VectorShear (   a,
  b,
 
)
Value:
do { \
(c)[2] = (b)[0] * (a)[1] + (b)[1] * (a)[2] + (b)[2]; \
(c)[1] = (b)[0] * (a)[0] + (b)[1]; \
(c)[0] = (b)[0]; \
} while (0)

Shear vector b by vector a.

Vector a represents the shear factors XY, XZ, YZ, ie in matrix form: [ 1 0 0 ] [ b0 ] [ a0 1 0 ] [ b1 ] [ a1 a2 1 ] [ b2 ]

The reason for this particular scheme is that is how Mat4Decompose calculates the shear from a matrix.

Note
The order of calculations is important for when b and c refer to the same vector.
#define VectorSubtract (   a,
  b,
 
)
Value:
do { \
(c)[0] = (a)[0] - (b)[0]; \
(c)[1] = (a)[1] - (b)[1]; \
(c)[2] = (a)[2] - (b)[2]; \
} while (0)
#define VectorUnshear (   a,
  b,
 
)
Value:
do { \
(c)[2] = (b)[2] - (b)[1] * (a)[2] - (b)[0] * ((a)[1]-(a)[0]*(a)[2]); \
(c)[1] = (b)[1] - (b)[0] * (a)[0]; \
(c)[0] = (b)[0]; \
} while (0)
#define VectorZero (   a)    ((a)[2] = (a)[1] = (a)[0] = 0);

Function Documentation

vec_t _DotProduct ( const vec3_t  v1,
const vec3_t  v2 
)
void _VectorAdd ( const vec3_t  veca,
const vec3_t  vecb,
vec3_t  out 
)
int _VectorCompare ( const vec3_t  v1,
const vec3_t  v2 
)
void _VectorCopy ( const vec3_t  in,
vec3_t  out 
)
vec_t _VectorLength ( const vec3_t  v)
void _VectorMA ( const vec3_t  veca,
float  scale,
const vec3_t  vecb,
vec3_t  vecc 
)
vec_t _VectorNormalize ( vec3_t  v)
void _VectorScale ( const vec3_t  in,
vec_t  scale,
vec3_t  out 
)
void _VectorSubtract ( const vec3_t  veca,
const vec3_t  vecb,
vec3_t  out 
)
void CrossProduct ( const vec3_t  v1,
const vec3_t  v2,
vec3_t  cross 
)
float VectorNormalize ( vec3_t  v)
inline

Variable Documentation

const vec_t* const vec3_origin