r_matrix.c File Reference

#include "r_local.h"
#include "r_matrix.h"
Include dependency graph for r_matrix.c:

Go to the source code of this file.

Functions

void Matrix4x4_Copy (matrix4x4_t *out, const matrix4x4_t *in)
void Matrix4x4_CopyRotateOnly (matrix4x4_t *out, const matrix4x4_t *in)
void Matrix4x4_CopyTranslateOnly (matrix4x4_t *out, const matrix4x4_t *in)
void Matrix4x4_Concat (matrix4x4_t *out, const matrix4x4_t *in1, const matrix4x4_t *in2)
void Matrix4x4_Transpose (matrix4x4_t *out, const matrix4x4_t *in1)
int Matrix4x4_Invert_Full (matrix4x4_t *out, const matrix4x4_t *in1)
void Matrix4x4_Invert_Simple (matrix4x4_t *out, const matrix4x4_t *in1)
void Matrix4x4_Interpolate (matrix4x4_t *out, matrix4x4_t *in1, matrix4x4_t *in2, double frac)
void Matrix4x4_Clear (matrix4x4_t *out)
void Matrix4x4_Accumulate (matrix4x4_t *out, matrix4x4_t *in, double weight)
void Matrix4x4_Normalize (matrix4x4_t *out, matrix4x4_t *in1)
void Matrix4x4_Normalize3 (matrix4x4_t *out, matrix4x4_t *in1)
void Matrix4x4_Reflect (matrix4x4_t *out, double normalx, double normaly, double normalz, double dist, double axisscale)
void Matrix4x4_CreateIdentity (matrix4x4_t *out)
void Matrix4x4_CreateTranslate (matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_CreateRotate (matrix4x4_t *out, double angle, double x, double y, double z)
void Matrix4x4_CreateScale (matrix4x4_t *out, double x)
void Matrix4x4_CreateScale3 (matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_CreateFromQuakeEntity (matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale)
void Matrix4x4_ToVectors (const matrix4x4_t *in, float vx[3], float vy[3], float vz[3], float t[3])
void Matrix4x4_FromVectors (matrix4x4_t *out, const float vx[3], const float vy[3], const float vz[3], const float t[3])
void Matrix4x4_ToArrayDoubleGL (const matrix4x4_t *in, double out[16])
void Matrix4x4_FromArrayDoubleGL (matrix4x4_t *out, const double in[16])
void Matrix4x4_ToArrayDoubleD3D (const matrix4x4_t *in, double out[16])
void Matrix4x4_FromArrayDoubleD3D (matrix4x4_t *out, const double in[16])
void Matrix4x4_ToArrayFloatGL (const matrix4x4_t *in, float out[16])
void Matrix4x4_FromArrayFloatGL (matrix4x4_t *out, const float in[16])
void Matrix4x4_ToArrayFloatD3D (const matrix4x4_t *in, float out[16])
void Matrix4x4_FromArrayFloatD3D (matrix4x4_t *out, const float in[16])
void Matrix4x4_ToArray12FloatGL (const matrix4x4_t *in, float out[12])
void Matrix4x4_FromArray12FloatGL (matrix4x4_t *out, const float in[12])
void Matrix4x4_ToArray12FloatD3D (const matrix4x4_t *in, float out[12])
void Matrix4x4_FromArray12FloatD3D (matrix4x4_t *out, const float in[12])
void Matrix4x4_FromOriginQuat (matrix4x4_t *m, double ox, double oy, double oz, double x, double y, double z, double w)
void Matrix4x4_ToOrigin3Quat4Float (const matrix4x4_t *m, float *origin, float *quat)
void Matrix4x4_FromDoom3Joint (matrix4x4_t *m, double ox, double oy, double oz, double x, double y, double z)
void Matrix4x4_FromBonePose6s (matrix4x4_t *m, float originscale, const short *pose6s)
void Matrix4x4_ToBonePose6s (const matrix4x4_t *m, float origininvscale, short *pose6s)
void Matrix4x4_Blend (matrix4x4_t *out, const matrix4x4_t *in1, const matrix4x4_t *in2, double blend)
void Matrix4x4_Transform (const matrix4x4_t *in, const float v[3], float out[3])
void Matrix4x4_Transform4 (const matrix4x4_t *in, const float v[4], float out[4])
void Matrix4x4_Transform3x3 (const matrix4x4_t *in, const float v[3], float out[3])
void Matrix4x4_TransformPositivePlane (const matrix4x4_t *in, float x, float y, float z, float d, float *o)
void Matrix4x4_TransformStandardPlane (const matrix4x4_t *in, float x, float y, float z, float d, float *o)
void Matrix4x4_ConcatTranslate (matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_ConcatRotate (matrix4x4_t *out, double angle, double x, double y, double z)
void Matrix4x4_ConcatScale (matrix4x4_t *out, double x)
void Matrix4x4_ConcatScale3 (matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_OriginFromMatrix (const matrix4x4_t *in, float *out)
double Matrix4x4_ScaleFromMatrix (const matrix4x4_t *in)
void Matrix4x4_SetOrigin (matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_AdjustOrigin (matrix4x4_t *out, double x, double y, double z)
void Matrix4x4_Scale (matrix4x4_t *out, double rotatescale, double originscale)
void Matrix4x4_Abs (matrix4x4_t *out)

Variables

const matrix4x4_t identitymatrix = { { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } } }

Function Documentation

void Matrix4x4_Abs ( matrix4x4_t out  ) 

Definition at line 1792 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Accumulate ( matrix4x4_t out,
matrix4x4_t in,
double  weight 
)

Definition at line 531 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_AdjustOrigin ( matrix4x4_t out,
double  x,
double  y,
double  z 
)

Definition at line 1757 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Blend ( matrix4x4_t out,
const matrix4x4_t in1,
const matrix4x4_t in2,
double  blend 
)

Definition at line 1571 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Clear ( matrix4x4_t out  ) 

Definition at line 523 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Concat ( matrix4x4_t out,
const matrix4x4_t in1,
const matrix4x4_t in2 
)
void Matrix4x4_ConcatRotate ( matrix4x4_t out,
double  angle,
double  x,
double  y,
double  z 
)

Definition at line 1699 of file r_matrix.c.

References Matrix4x4_Concat(), and Matrix4x4_CreateRotate().

void Matrix4x4_ConcatScale ( matrix4x4_t out,
double  x 
)

Definition at line 1708 of file r_matrix.c.

References Matrix4x4_Concat(), and Matrix4x4_CreateScale().

void Matrix4x4_ConcatScale3 ( matrix4x4_t out,
double  x,
double  y,
double  z 
)

Definition at line 1717 of file r_matrix.c.

References Matrix4x4_Concat(), and Matrix4x4_CreateScale3().

void Matrix4x4_ConcatTranslate ( matrix4x4_t out,
double  x,
double  y,
double  z 
)

Definition at line 1690 of file r_matrix.c.

References Matrix4x4_Concat(), and Matrix4x4_CreateTranslate().

void Matrix4x4_Copy ( matrix4x4_t out,
const matrix4x4_t in 
)

Definition at line 26 of file r_matrix.c.

void Matrix4x4_CopyRotateOnly ( matrix4x4_t out,
const matrix4x4_t in 
)

Definition at line 31 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_CopyTranslateOnly ( matrix4x4_t out,
const matrix4x4_t in 
)

Definition at line 51 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_CreateFromQuakeEntity ( matrix4x4_t out,
double  x,
double  y,
double  z,
double  pitch,
double  yaw,
double  roll,
double  scale 
)

Definition at line 753 of file r_matrix.c.

References matrix4x4_s::m, and torad.

void Matrix4x4_CreateIdentity ( matrix4x4_t out  ) 

Definition at line 602 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_CreateRotate ( matrix4x4_t out,
double  angle,
double  x,
double  y,
double  z 
)

Definition at line 661 of file r_matrix.c.

References f, len, matrix4x4_s::m, and torad.

Referenced by Matrix4x4_ConcatRotate().

void Matrix4x4_CreateScale ( matrix4x4_t out,
double  x 
)

Definition at line 713 of file r_matrix.c.

References matrix4x4_s::m.

Referenced by Matrix4x4_ConcatScale().

void Matrix4x4_CreateScale3 ( matrix4x4_t out,
double  x,
double  y,
double  z 
)

Definition at line 733 of file r_matrix.c.

References matrix4x4_s::m.

Referenced by Matrix4x4_ConcatScale3().

void Matrix4x4_CreateTranslate ( matrix4x4_t out,
double  x,
double  y,
double  z 
)

Definition at line 622 of file r_matrix.c.

References matrix4x4_s::m.

Referenced by Matrix4x4_ConcatTranslate().

void Matrix4x4_FromArray12FloatD3D ( matrix4x4_t out,
const float  in[12] 
)

Definition at line 1407 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromArray12FloatGL ( matrix4x4_t out,
const float  in[12] 
)

Definition at line 1337 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromArrayDoubleD3D ( matrix4x4_t out,
const double  in[16] 
)

Definition at line 1111 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromArrayDoubleGL ( matrix4x4_t out,
const double  in[16] 
)

Definition at line 1033 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromArrayFloatD3D ( matrix4x4_t out,
const float  in[16] 
)

Definition at line 1267 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromArrayFloatGL ( matrix4x4_t out,
const float  in[16] 
)

Definition at line 1189 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromBonePose6s ( matrix4x4_t m,
float  originscale,
const short *  pose6s 
)

Definition at line 1531 of file r_matrix.c.

References Matrix4x4_FromOriginQuat().

void Matrix4x4_FromDoom3Joint ( matrix4x4_t m,
double  ox,
double  oy,
double  oz,
double  x,
double  y,
double  z 
)

LordHavoc: I got this code from: http://www.doom3world.org/phpbb2/viewtopic.php?t=2884

Definition at line 1502 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_FromOriginQuat ( matrix4x4_t m,
double  ox,
double  oy,
double  oz,
double  x,
double  y,
double  z,
double  w 
)

Definition at line 1446 of file r_matrix.c.

References matrix4x4_s::m.

Referenced by Matrix4x4_FromBonePose6s().

void Matrix4x4_FromVectors ( matrix4x4_t out,
const float  vx[3],
const float  vy[3],
const float  vz[3],
const float  t[3] 
)

Definition at line 955 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Interpolate ( matrix4x4_t out,
matrix4x4_t in1,
matrix4x4_t in2,
double  frac 
)

Definition at line 515 of file r_matrix.c.

References matrix4x4_s::m.

int Matrix4x4_Invert_Full ( matrix4x4_t out,
const matrix4x4_t in1 
)

Adapted from code contributed to Mesa by David Moore (Mesa 7.6 under SGI Free License B - which is MIT/X11-type) added helper for common subexpression elimination by eihrul, and other optimizations by div0

Definition at line 170 of file r_matrix.c.

References f, and matrix4x4_s::m.

void Matrix4x4_Invert_Simple ( matrix4x4_t out,
const matrix4x4_t in1 
)

Definition at line 462 of file r_matrix.c.

References matrix4x4_s::m, and scale.

void Matrix4x4_Normalize ( matrix4x4_t out,
matrix4x4_t in1 
)

Definition at line 539 of file r_matrix.c.

References matrix4x4_s::m, Matrix4x4_Scale(), and scale.

void Matrix4x4_Normalize3 ( matrix4x4_t out,
matrix4x4_t in1 
)

Definition at line 548 of file r_matrix.c.

References matrix4x4_s::m, and scale.

void Matrix4x4_OriginFromMatrix ( const matrix4x4_t in,
float *  out 
)

Definition at line 1725 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Reflect ( matrix4x4_t out,
double  normalx,
double  normaly,
double  normalz,
double  dist,
double  axisscale 
)

Definition at line 574 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Scale ( matrix4x4_t out,
double  rotatescale,
double  originscale 
)

Definition at line 1770 of file r_matrix.c.

References matrix4x4_s::m.

Referenced by Matrix4x4_Normalize().

double Matrix4x4_ScaleFromMatrix ( const matrix4x4_t in  ) 

Definition at line 1738 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_SetOrigin ( matrix4x4_t out,
double  x,
double  y,
double  z 
)

Definition at line 1744 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToArray12FloatD3D ( const matrix4x4_t in,
float  out[12] 
)

Definition at line 1376 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToArray12FloatGL ( const matrix4x4_t in,
float  out[12] 
)

Definition at line 1306 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToArrayDoubleD3D ( const matrix4x4_t in,
double  out[16] 
)

Definition at line 1072 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToArrayDoubleGL ( const matrix4x4_t in,
double  out[16] 
)

Definition at line 994 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToArrayFloatD3D ( const matrix4x4_t in,
float  out[16] 
)

Definition at line 1228 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToArrayFloatGL ( const matrix4x4_t in,
float  out[16] 
)

Definition at line 1150 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_ToBonePose6s ( const matrix4x4_t m,
float  origininvscale,
short *  pose6s 
)

Definition at line 1546 of file r_matrix.c.

References Matrix4x4_ToOrigin3Quat4Float().

void Matrix4x4_ToOrigin3Quat4Float ( const matrix4x4_t m,
float *  origin,
float *  quat 
)
void Matrix4x4_ToVectors ( const matrix4x4_t in,
float  vx[3],
float  vy[3],
float  vz[3],
float  t[3] 
)

Definition at line 924 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Transform ( const matrix4x4_t in,
const float  v[3],
float  out[3] 
)

Definition at line 1592 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Transform3x3 ( const matrix4x4_t in,
const float  v[3],
float  out[3] 
)

Definition at line 1620 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_Transform4 ( const matrix4x4_t in,
const float  v[4],
float  out[4] 
)

Definition at line 1605 of file r_matrix.c.

References matrix4x4_s::m.

void Matrix4x4_TransformPositivePlane ( const matrix4x4_t in,
float  x,
float  y,
float  z,
float  d,
float *  o 
)

Definition at line 1633 of file r_matrix.c.

References matrix4x4_s::m, and scale.

void Matrix4x4_TransformStandardPlane ( const matrix4x4_t in,
float  x,
float  y,
float  z,
float  d,
float *  o 
)

Definition at line 1650 of file r_matrix.c.

References matrix4x4_s::m, and scale.

void Matrix4x4_Transpose ( matrix4x4_t out,
const matrix4x4_t in1 
)

Definition at line 145 of file r_matrix.c.

References matrix4x4_s::m.


Variable Documentation

const matrix4x4_t identitymatrix = { { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } } }

Definition at line 24 of file r_matrix.c.


Generated by  doxygen 1.6.2