UFO: Alien Invasion
Loading...
Searching...
No Matches
r_matrix.cpp File Reference
#include "r_local.h"
#include "r_matrix.h"
Include dependency graph for r_matrix.cpp:

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

◆ Matrix4x4_Abs()

void Matrix4x4_Abs ( matrix4x4_t * out)

Definition at line 1787 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Accumulate()

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

Definition at line 529 of file r_matrix.cpp.

References i, and matrix4x4_t::m.

◆ Matrix4x4_AdjustOrigin()

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

Definition at line 1752 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Blend()

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

Definition at line 1566 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Clear()

void Matrix4x4_Clear ( matrix4x4_t * out)

Definition at line 522 of file r_matrix.cpp.

References i, and matrix4x4_t::m.

◆ Matrix4x4_Concat()

void Matrix4x4_Concat ( matrix4x4_t * out,
const matrix4x4_t * in1,
const matrix4x4_t * in2 )

◆ Matrix4x4_ConcatRotate()

void Matrix4x4_ConcatRotate ( matrix4x4_t * out,
double angle,
double x,
double y,
double z )

Definition at line 1694 of file r_matrix.cpp.

References Matrix4x4_Concat(), and Matrix4x4_CreateRotate().

◆ Matrix4x4_ConcatScale()

void Matrix4x4_ConcatScale ( matrix4x4_t * out,
double x )

Definition at line 1703 of file r_matrix.cpp.

References Matrix4x4_Concat(), and Matrix4x4_CreateScale().

◆ Matrix4x4_ConcatScale3()

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

Definition at line 1712 of file r_matrix.cpp.

References Matrix4x4_Concat(), and Matrix4x4_CreateScale3().

◆ Matrix4x4_ConcatTranslate()

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

Definition at line 1685 of file r_matrix.cpp.

References Matrix4x4_Concat(), and Matrix4x4_CreateTranslate().

◆ Matrix4x4_Copy()

void Matrix4x4_Copy ( matrix4x4_t * out,
const matrix4x4_t * in )

Definition at line 26 of file r_matrix.cpp.

◆ Matrix4x4_CopyRotateOnly()

void Matrix4x4_CopyRotateOnly ( matrix4x4_t * out,
const matrix4x4_t * in )

Definition at line 31 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_CopyTranslateOnly()

void Matrix4x4_CopyTranslateOnly ( matrix4x4_t * out,
const matrix4x4_t * in )

Definition at line 51 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_CreateFromQuakeEntity()

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

Definition at line 748 of file r_matrix.cpp.

References matrix4x4_t::m, scale, and torad.

Referenced by R_TransformForEntity().

◆ Matrix4x4_CreateIdentity()

void Matrix4x4_CreateIdentity ( matrix4x4_t * out)

Definition at line 597 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_CreateRotate()

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

Definition at line 656 of file r_matrix.cpp.

References len, matrix4x4_t::m, and torad.

Referenced by Matrix4x4_ConcatRotate().

◆ Matrix4x4_CreateScale()

void Matrix4x4_CreateScale ( matrix4x4_t * out,
double x )

Definition at line 708 of file r_matrix.cpp.

References matrix4x4_t::m.

Referenced by Matrix4x4_ConcatScale().

◆ Matrix4x4_CreateScale3()

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

Definition at line 728 of file r_matrix.cpp.

References matrix4x4_t::m.

Referenced by Matrix4x4_ConcatScale3().

◆ Matrix4x4_CreateTranslate()

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

Definition at line 617 of file r_matrix.cpp.

References matrix4x4_t::m.

Referenced by Matrix4x4_ConcatTranslate().

◆ Matrix4x4_FromArray12FloatD3D()

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

Definition at line 1402 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_FromArray12FloatGL()

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

Definition at line 1332 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_FromArrayDoubleD3D()

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

Definition at line 1106 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_FromArrayDoubleGL()

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

Definition at line 1028 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_FromArrayFloatD3D()

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

Definition at line 1262 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_FromArrayFloatGL()

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

Definition at line 1184 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_FromBonePose6s()

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

Definition at line 1526 of file r_matrix.cpp.

References m, and Matrix4x4_FromOriginQuat().

◆ Matrix4x4_FromDoom3Joint()

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 1497 of file r_matrix.cpp.

References m.

◆ Matrix4x4_FromOriginQuat()

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

Definition at line 1441 of file r_matrix.cpp.

References m.

Referenced by Matrix4x4_FromBonePose6s().

◆ Matrix4x4_FromVectors()

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 950 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Interpolate()

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

Definition at line 515 of file r_matrix.cpp.

References i, and matrix4x4_t::m.

◆ Matrix4x4_Invert_Full()

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.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Invert_Simple()

void Matrix4x4_Invert_Simple ( matrix4x4_t * out,
const matrix4x4_t * in1 )

Definition at line 462 of file r_matrix.cpp.

References matrix4x4_t::m, and scale.

Referenced by R_TransformForEntity().

◆ Matrix4x4_Normalize()

void Matrix4x4_Normalize ( matrix4x4_t * out,
matrix4x4_t * in1 )

Definition at line 536 of file r_matrix.cpp.

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

◆ Matrix4x4_Normalize3()

void Matrix4x4_Normalize3 ( matrix4x4_t * out,
matrix4x4_t * in1 )

Definition at line 545 of file r_matrix.cpp.

References i, matrix4x4_t::m, and scale.

◆ Matrix4x4_OriginFromMatrix()

void Matrix4x4_OriginFromMatrix ( const matrix4x4_t * in,
float * out )

Definition at line 1720 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Reflect()

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

Definition at line 570 of file r_matrix.cpp.

References i, and matrix4x4_t::m.

◆ Matrix4x4_Scale()

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

Definition at line 1765 of file r_matrix.cpp.

References matrix4x4_t::m.

Referenced by Matrix4x4_Normalize().

◆ Matrix4x4_ScaleFromMatrix()

double Matrix4x4_ScaleFromMatrix ( const matrix4x4_t * in)

Definition at line 1733 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_SetOrigin()

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

Definition at line 1739 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToArray12FloatD3D()

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

Definition at line 1371 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToArray12FloatGL()

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

Definition at line 1301 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToArrayDoubleD3D()

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

Definition at line 1067 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToArrayDoubleGL()

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

Definition at line 989 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToArrayFloatD3D()

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

Definition at line 1223 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToArrayFloatGL()

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

Definition at line 1145 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_ToBonePose6s()

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

Definition at line 1541 of file r_matrix.cpp.

References m, and Matrix4x4_ToOrigin3Quat4Float().

◆ Matrix4x4_ToOrigin3Quat4Float()

void Matrix4x4_ToOrigin3Quat4Float ( const matrix4x4_t * m,
float * origin,
float * quat )

◆ Matrix4x4_ToVectors()

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

Definition at line 919 of file r_matrix.cpp.

References matrix4x4_t::m.

◆ Matrix4x4_Transform()

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

Definition at line 1587 of file r_matrix.cpp.

References matrix4x4_t::m, and v.

Referenced by R_TransformForEntity().

◆ Matrix4x4_Transform3x3()

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

Definition at line 1615 of file r_matrix.cpp.

References matrix4x4_t::m, and v.

◆ Matrix4x4_Transform4()

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

Definition at line 1600 of file r_matrix.cpp.

References matrix4x4_t::m, and v.

◆ Matrix4x4_TransformPositivePlane()

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

Definition at line 1628 of file r_matrix.cpp.

References matrix4x4_t::m, and scale.

◆ Matrix4x4_TransformStandardPlane()

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

Definition at line 1645 of file r_matrix.cpp.

References matrix4x4_t::m, and scale.

◆ Matrix4x4_Transpose()

void Matrix4x4_Transpose ( matrix4x4_t * out,
const matrix4x4_t * in1 )

Definition at line 145 of file r_matrix.cpp.

References matrix4x4_t::m.

Variable Documentation

◆ identitymatrix

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.cpp.