Mario Kart 64
Loading...
Searching...
No Matches
matrix.c File Reference
#include <libultraship.h>
#include <math.h>
#include "matrix.h"
#include "common_structs.h"
#include "FrameInterpolation.h"
Include dependency graph for matrix.c:

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)
 

Variables

Mtx gIdentityMtx = gdSPDefMtx(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f)
 
Matrix gIdentityMatrix
 
MatrixgGfxMatrix
 
Matrix sGfxMatrixStack [0x20]
 
MatrixgCalcMatrix
 
Matrix sCalcMatrixStack [0x20]
 
Mtx gMainMatrixStack [0x480]
 
Mtx * gGfxMtx
 

Function Documentation

◆ 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

◆ gGfxMatrix

Matrix* gGfxMatrix

◆ gGfxMtx

Mtx* gGfxMtx

◆ gIdentityMatrix

Matrix gIdentityMatrix
Initial value:
= { {
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f },
} }

◆ gIdentityMtx

Mtx gIdentityMtx = gdSPDefMtx(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f)

◆ gMainMatrixStack

Mtx gMainMatrixStack[0x480]

◆ sCalcMatrixStack

Matrix sCalcMatrixStack[0x20]

◆ sGfxMatrixStack

Matrix sGfxMatrixStack[0x20]