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

Macros

#define Mat3Add(a, b, c)
 
#define Mat3Blend(m1, m2, b, m)
 
#define Mat3CompMult(a, b, c)
 
#define Mat3Copy(a, b)
 
#define Mat3Expand(a)
 
#define Mat3Identity(a)
 
#define Mat3MultAdd(a, s, b, c)
 
#define Mat3Scale(a, b, c)
 
#define Mat3Subtract(a, b, c)
 
#define Mat3Trace(a)   ((a)[0] + (a)[4] + (a)[8])
 
#define Mat3Zero(a)   memset ((a), 0, 9 * sizeof (a)[0])
 
#define Mat4toMat3(a, b)
 

Functions

int Mat3Decompose (const mat4_t mat, quat_t rot, vec3_t shear, vec3_t scale)
 Decompose a 3x3 column major matrix into its component transformations. More...
 
vec_t Mat3Determinant (const mat3_t m)
 
void Mat3Init (const quat_t rot, const vec3_t scale, mat3_t mat)
 
int Mat3Inverse (const mat3_t a, mat3_t b)
 
void Mat3Mult (const mat3_t a, const mat3_t b, mat3_t c)
 
void Mat3MultVec (const mat3_t a, const vec3_t b, vec3_t c)
 
void Mat3SymEigen (const mat3_t m, vec3_t e)
 
void Mat3Transpose (const mat3_t a, mat3_t b)
 

Detailed Description

Macro Definition Documentation

#define Mat3Add (   a,
  b,
 
)
Value:
do { \
VectorAdd ((a) + 0, (b) + 0, (c) + 0); \
VectorAdd ((a) + 3, (b) + 3, (c) + 3); \
VectorAdd ((a) + 6, (b) + 6, (c) + 6); \
} while (0)
#define VectorAdd(a, b, c)
Definition: vector.h:53
#define Mat3Blend (   m1,
  m2,
  b,
 
)
Value:
do { \
VectorBlend ((m1) + 0, (m2) + 0, (b), (m) + 0); \
VectorBlend ((m1) + 3, (m2) + 3, (b), (m) + 3); \
VectorBlend ((m1) + 6, (m2) + 6, (b), (m) + 6); \
} while (0)
#define VectorBlend(v1, v2, b, v)
Definition: vector.h:153
#define Mat3CompMult (   a,
  b,
 
)
Value:
do { \
VectorCompMult ((a) + 0, (b) + 0, (c) + 0); \
VectorCompMult ((a) + 3, (b) + 3, (c) + 3); \
VectorCompMult ((a) + 6, (b) + 6, (c) + 6); \
} while (0)
#define VectorCompMult(a, b, c)
Definition: vector.h:110
#define Mat3Copy (   a,
 
)
Value:
do { \
VectorCopy ((a) + 0, (b) + 0); \
VectorCopy ((a) + 3, (b) + 3); \
VectorCopy ((a) + 6, (b) + 6); \
} while (0)
#define VectorCopy(a, b)
Definition: vector.h:59
#define Mat3Expand (   a)
Value:
VectorExpand ((a) + 0), \
VectorExpand ((a) + 3), \
VectorExpand ((a) + 6)
#define VectorExpand(v)
Definition: vector.h:161
#define Mat3Identity (   a)
Value:
do { \
Mat3Zero (a); \
(a)[8] = (a)[4] = (a)[0] = 1; \
} while (0)
#define Mat3Zero(a)
Definition: matrix3.h:71
#define Mat3MultAdd (   a,
  s,
  b,
 
)
Value:
do { \
VectorMultAdd ((a) + 0, s, (b) + 0, (c) + 0); \
VectorMultAdd ((a) + 3, s, (b) + 3, (c) + 3); \
VectorMultAdd ((a) + 6, s, (b) + 6, (c) + 6); \
} while (0)
#define VectorMultAdd(a, s, b, c)
Definition: vector.h:65
#define Mat3Scale (   a,
  b,
 
)
Value:
do { \
VectorScale ((a) + 0, (b), (c) + 0); \
VectorScale ((a) + 3, (b), (c) + 3); \
VectorScale ((a) + 6, (b), (c) + 6); \
} while (0)
#define VectorScale(a, b, c)
Definition: vector.h:79
#define Mat3Subtract (   a,
  b,
 
)
Value:
do { \
VectorSubtract ((a) + 0, (b) + 0, (c) + 0); \
VectorSubtract ((a) + 3, (b) + 3, (c) + 3); \
VectorSubtract ((a) + 6, (b) + 6, (c) + 6); \
} while (0)
#define VectorSubtract(a, b, c)
Definition: vector.h:41
#define Mat3Trace (   a)    ((a)[0] + (a)[4] + (a)[8])
#define Mat3Zero (   a)    memset ((a), 0, 9 * sizeof (a)[0])
#define Mat4toMat3 (   a,
 
)
Value:
do { \
VectorCopy ((a) + 0, (b) + 0); \
VectorCopy ((a) + 4, (b) + 3); \
VectorCopy ((a) + 8, (b) + 6); \
} while (0)
#define VectorCopy(a, b)
Definition: vector.h:59

Function Documentation

int Mat3Decompose ( const mat4_t  mat,
quat_t  rot,
vec3_t  shear,
vec3_t  scale 
)

Decompose a 3x3 column major matrix into its component transformations.

This gives the matrix's rotation as a quaternion, shear (XY, XZ, YZ), and scale. Using the following sequence will give the same result as multiplying v by mat.

QuatMultVec (rot, v, v); VectorShear (shear, v, v); VectorCompMult (scale, v, v);

vec_t Mat3Determinant ( const mat3_t  m)
void Mat3Init ( const quat_t  rot,
const vec3_t  scale,
mat3_t  mat 
)
int Mat3Inverse ( const mat3_t  a,
mat3_t  b 
)
void Mat3Mult ( const mat3_t  a,
const mat3_t  b,
mat3_t  c 
)
void Mat3MultVec ( const mat3_t  a,
const vec3_t  b,
vec3_t  c 
)
void Mat3SymEigen ( const mat3_t  m,
vec3_t  e 
)
void Mat3Transpose ( const mat3_t  a,
mat3_t  b 
)