Mario Kart 64
Loading...
Searching...
No Matches
matrix.h File Reference
#include "common_structs.h"
Include dependency graph for matrix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Color
 
struct  Vec3fInterp
 
struct  Vec3sInterp
 
struct  Mat4Interp
 

Macros

#define MTXF_NEW   0
 
#define MTXF_APPLY   1
 
#define M_PI   3.14159265358979323846f
 
#define M_RTOD   (180.0f / M_PI)
 
#define SQ(val)
 
#define qs1616(e)
 
#define IPART(x)
 
#define FPART(x)
 
#define gdSPDefMtx(xx, yx, zx, wx, xy, yy, zy, wy, xz, yz, zz, wz, xw, yw, zw, ww)
 

Typedefs

typedef MtxF Matrix
 

Functions

void Matrix_InitPerspective (Gfx **dList)
 
void Matrix_InitOrtho (Gfx **dList)
 
void Matrix_Copy (Matrix *dst, Matrix *src)
 
void Matrix_Push (Matrix **mtxStack)
 
void Matrix_Pop (Matrix **mtxStack)
 
void Matrix_Mult (Matrix *mtx, Matrix *tf, u8 mode)
 
void Matrix_Translate (Matrix *mtx, f32 x, f32 y, f32 z, u8 mode)
 
void Matrix_Scale (Matrix *mtx, f32 xScale, f32 yScale, f32 zScale, u8 mode)
 
void Matrix_RotateX (Matrix *mtx, f32 angle, u8 mode)
 
void Matrix_RotateY (Matrix *mtx, f32 angle, u8 mode)
 
void Matrix_RotateZ (Matrix *mtx, f32 angle, u8 mode)
 
void Matrix_RotateAxis (Matrix *mtx, f32 angle, f32 axisX, f32 axisY, f32 axisZ, u8 mode)
 
void Matrix_ToMtx (Mtx *dest)
 
void Matrix_FromMtx (Mtx *src, Matrix *dest)
 
void Matrix_MultVec3f (Matrix *mtx, Vec3f *src, Vec3f *dest)
 
void Matrix_MultVec3fNoTranslate (Matrix *mtx, Vec3f *src, Vec3f *dest)
 
void Matrix_GetYRPAngles (Matrix *mtx, Vec3f *rot)
 
void Matrix_GetXYZAngles (Matrix *mtx, Vec3f *rot)
 
void Matrix_LookAt (Matrix *mtx, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, u8 mode)
 
void Matrix_SetGfxMtx (Gfx **gfx)
 
void Lights_SetOneLight (Gfx **dList, s32 dirX, s32 dirY, s32 dirZ, s32 colR, s32 colG, s32 colB, s32 ambR, s32 ambG, s32 ambB)
 

Variables

Mtx gIdentityMtx
 
Matrix gIdentityMatrix
 
MatrixgGfxMatrix
 
Matrix sGfxMatrixStack []
 
MatrixgCalcMatrix
 
Matrix sCalcMatrixStack []
 
Mtx gMainMatrixStack []
 
Mtx * gGfxMtx
 

Macro Definition Documentation

◆ FPART

#define FPART ( x)
Value:
(qs1616(x) & 0xFFFF)
#define qs1616(e)
Definition matrix.h:34

◆ gdSPDefMtx

#define gdSPDefMtx ( xx,
yx,
zx,
wx,
xy,
yy,
zy,
wy,
xz,
yz,
zz,
wz,
xw,
yw,
zw,
ww )
Value:
{ \
{ \
(IPART(xx) << 0x10) | IPART(xy), (IPART(xz) << 0x10) | IPART(xw), (IPART(yx) << 0x10) | IPART(yy), \
(IPART(yz) << 0x10) | IPART(yw), (IPART(zx) << 0x10) | IPART(zy), (IPART(zz) << 0x10) | IPART(zw), \
(IPART(wx) << 0x10) | IPART(wy), (IPART(wz) << 0x10) | IPART(ww), (FPART(xx) << 0x10) | FPART(xy), \
(FPART(xz) << 0x10) | FPART(xw), (FPART(yx) << 0x10) | FPART(yy), (FPART(yz) << 0x10) | FPART(yw), \
(FPART(zx) << 0x10) | FPART(zy), (FPART(zz) << 0x10) | FPART(zw), (FPART(wx) << 0x10) | FPART(wy), \
(FPART(wz) << 0x10) | FPART(ww), \
} \
}
#define FPART(x)
Definition matrix.h:37
#define IPART(x)
Definition matrix.h:36

◆ IPART

#define IPART ( x)
Value:
((qs1616(x) >> 16) & 0xFFFF)

◆ M_PI

#define M_PI   3.14159265358979323846f

◆ M_RTOD

#define M_RTOD   (180.0f / M_PI)

◆ MTXF_APPLY

#define MTXF_APPLY   1

◆ MTXF_NEW

#define MTXF_NEW   0

◆ qs1616

#define qs1616 ( e)
Value:
((s32) ((e) *0x00010000))

◆ SQ

#define SQ ( val)
Value:
((val) * (val))

Typedef Documentation

◆ Matrix

typedef MtxF Matrix

Function Documentation

◆ Lights_SetOneLight()

void Lights_SetOneLight ( Gfx ** dList,
s32 dirX,
s32 dirY,
s32 dirZ,
s32 colR,
s32 colG,
s32 colB,
s32 ambR,
s32 ambG,
s32 ambB )

◆ Matrix_Copy()

void Matrix_Copy ( Matrix * dst,
Matrix * src )
Here is the caller graph for this function:

◆ Matrix_FromMtx()

void Matrix_FromMtx ( Mtx * src,
Matrix * dest )
Here is the call graph for this function:

◆ Matrix_GetXYZAngles()

void Matrix_GetXYZAngles ( Matrix * mtx,
Vec3f * rot )
Here is the call graph for this function:

◆ Matrix_GetYRPAngles()

void Matrix_GetYRPAngles ( Matrix * mtx,
Vec3f * rot )
Here is the call graph for this function:

◆ Matrix_InitOrtho()

void Matrix_InitOrtho ( Gfx ** dList)
Here is the call graph for this function:

◆ Matrix_InitPerspective()

void Matrix_InitPerspective ( Gfx ** dList)
Here is the call graph for this function:

◆ Matrix_LookAt()

void Matrix_LookAt ( Matrix * mtx,
f32 xEye,
f32 yEye,
f32 zEye,
f32 xAt,
f32 yAt,
f32 zAt,
f32 xUp,
f32 yUp,
f32 zUp,
u8 mode )
Here is the call graph for this function:

◆ Matrix_Mult()

void Matrix_Mult ( Matrix * mtx,
Matrix * tf,
u8 mode )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Matrix_MultVec3f()

void Matrix_MultVec3f ( Matrix * mtx,
Vec3f * src,
Vec3f * dest )

◆ Matrix_MultVec3fNoTranslate()

void Matrix_MultVec3fNoTranslate ( Matrix * mtx,
Vec3f * src,
Vec3f * dest )
Here is the caller graph for this function:

◆ Matrix_Pop()

void Matrix_Pop ( Matrix ** mtxStack)

◆ Matrix_Push()

void Matrix_Push ( Matrix ** mtxStack)
Here is the call graph for this function:

◆ Matrix_RotateAxis()

void Matrix_RotateAxis ( Matrix * mtx,
f32 angle,
f32 axisX,
f32 axisY,
f32 axisZ,
u8 mode )
Here is the call graph for this function:

◆ Matrix_RotateX()

void Matrix_RotateX ( Matrix * mtx,
f32 angle,
u8 mode )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Matrix_RotateY()

void Matrix_RotateY ( Matrix * mtx,
f32 angle,
u8 mode )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Matrix_RotateZ()

void Matrix_RotateZ ( Matrix * mtx,
f32 angle,
u8 mode )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Matrix_Scale()

void Matrix_Scale ( Matrix * mtx,
f32 xScale,
f32 yScale,
f32 zScale,
u8 mode )

◆ Matrix_SetGfxMtx()

void Matrix_SetGfxMtx ( Gfx ** gfx)
Here is the call graph for this function:

◆ Matrix_ToMtx()

void Matrix_ToMtx ( Mtx * dest)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Matrix_Translate()

void Matrix_Translate ( Matrix * mtx,
f32 x,
f32 y,
f32 z,
u8 mode )

Variable Documentation

◆ gCalcMatrix

Matrix* gCalcMatrix
extern

◆ gGfxMatrix

Matrix* gGfxMatrix
extern

◆ gGfxMtx

Mtx* gGfxMtx
extern

◆ gIdentityMatrix

Matrix gIdentityMatrix
extern

◆ gIdentityMtx

Mtx gIdentityMtx
extern

◆ gMainMatrixStack

Mtx gMainMatrixStack[]
extern

◆ sCalcMatrixStack

Matrix sCalcMatrixStack[]
extern

◆ sGfxMatrixStack

Matrix sGfxMatrixStack[]
extern