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

Go to the source code of this file.

Macros

#define COLLISION   0x1
 
#define NO_COLLISION   0x0
 

Functions

void nullify_displaylist (uintptr_t)
 
void func_802AAAAC (Collision *)
 
f32 func_802AAB4C (Player *)
 
s32 check_collision_zx (Collision *, f32, f32, f32, f32, u16)
 
s32 check_collision_yx (Collision *, f32, f32, f32, f32, u16)
 
s32 check_collision_zy (Collision *, f32, f32, f32, f32, u16)
 
s8 get_surface_type (u16)
 
s16 get_track_section_id (u16)
 
s16 func_802ABD7C (u16)
 
s16 func_802ABDB8 (u16)
 
s16 func_802ABDF4 (u16)
 
f32 calculate_surface_height (f32, f32, f32, u16)
 
f32 func_802ABEAC (Collision *, Vec3f)
 
void shell_collision (Collision *, Vec3f)
 
void process_shell_collision (Vec3f, f32, Vec3f, f32)
 
u16 player_terrain_collision (Player *, KartTyre *, f32, f32, f32)
 
void adjust_pos_orthogonally (Vec3f, f32, Vec3f, f32)
 
s32 detect_tyre_collision (KartTyre *)
 
u16 actor_terrain_collision (Collision *, f32, f32, f32, f32, f32, f32, f32)
 
u16 check_bounding_collision (Collision *, f32, f32, f32, f32)
 
f32 spawn_actor_on_surface (f32, f32, f32)
 
void set_vtx_buffer (uintptr_t, u32, u32)
 
s32 is_line_intersecting_rectangle (s16, s16, s16, s16, s16, s16, s16, s16)
 
s32 is_triangle_intersecting_bounding_box (s16, s16, s16, s16, u16)
 
void generate_collision_grid (void)
 
void generate_collision_mesh_with_defaults (Gfx *)
 
void generate_collision_mesh_with_default_section_id (Gfx *, s8)
 
void generate_collision_mesh (Gfx *, s8, u16)
 
void find_and_set_tile_size (uintptr_t, s32, s32)
 
void set_vertex_colours (uintptr_t, u32, s32, s8, u8, u8, u8)
 
void find_vtx_and_set_colours (uintptr_t, s8, u8, u8, u8)
 
void subtract_scaled_vector (Vec3f, f32, Vec3f)
 

Macro Definition Documentation

◆ COLLISION

#define COLLISION   0x1

◆ NO_COLLISION

#define NO_COLLISION   0x0

Function Documentation

◆ actor_terrain_collision()

u16 actor_terrain_collision ( Collision * collision,
f32 boundingBoxSize,
f32 newX,
f32 newY,
f32 newZ,
f32 oldX,
f32 oldY,
f32 oldZ )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ adjust_pos_orthogonally()

void adjust_pos_orthogonally ( Vec3f ,
f32 ,
Vec3f ,
f32  )

◆ calculate_surface_height()

f32 calculate_surface_height ( f32 x,
f32 y,
f32 z,
u16 index )
Here is the caller graph for this function:

◆ check_bounding_collision()

u16 check_bounding_collision ( Collision * collision,
f32 boundingBoxSize,
f32 posX,
f32 posY,
f32 posZ )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_collision_yx()

s32 check_collision_yx ( Collision * collision,
f32 boundingBoxSize,
f32 posX,
f32 posY,
f32 posZ,
u16 index )
Here is the caller graph for this function:

◆ check_collision_zx()

s32 check_collision_zx ( Collision * collision,
f32 boundingBoxSize,
f32 posX,
f32 posY,
f32 posZ,
u16 index )
Here is the caller graph for this function:

◆ check_collision_zy()

s32 check_collision_zy ( Collision * collision,
f32 boundingBoxSize,
f32 posX,
f32 posY,
f32 posZ,
u16 index )
Here is the caller graph for this function:

◆ detect_tyre_collision()

s32 detect_tyre_collision ( KartTyre * tyre)
Bug
Here is the call graph for this function:

◆ find_and_set_tile_size()

void find_and_set_tile_size ( uintptr_t addr,
s32 uls,
s32 ult )

Search for G_SETTILESIZE and set its args.

Here is the caller graph for this function:

◆ find_vtx_and_set_colours()

void find_vtx_and_set_colours ( uintptr_t displayList,
s8 alpha,
u8 red,
u8 green,
u8 blue )

Recursive search for vertices and set their colour values.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_802AAAAC()

void func_802AAAAC ( Collision * collision)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_802AAB4C()

f32 func_802AAB4C ( Player * player)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_802ABD7C()

s16 func_802ABD7C ( u16 index)
Here is the caller graph for this function:

◆ func_802ABDB8()

s16 func_802ABDB8 ( u16 index)
Here is the caller graph for this function:

◆ func_802ABDF4()

s16 func_802ABDF4 ( u16 index)
Here is the caller graph for this function:

◆ func_802ABEAC()

f32 func_802ABEAC ( Collision * collision,
Vec3f pos )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_collision_grid()

void generate_collision_grid ( void )

Splits the collision mesh into 32x32 sections. This allows the game to check only nearby geography for a collision rather than checking against the whole collision mesh. (checking against the whole mesh for every actor would be expensive)

Warning
gNextFreeMemoryAddress incremented just outside this function. Bad practice to hide memory allocation like this.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_collision_mesh()

void generate_collision_mesh ( Gfx * addr,
s8 surfaceType,
u16 sectionId )

Generate via a recursive search and set for vertex data.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_collision_mesh_with_default_section_id()

void generate_collision_mesh_with_default_section_id ( Gfx * gfx,
s8 surfaceType )

Recursive search for vtx and set sectionId's to 0xFF

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_collision_mesh_with_defaults()

void generate_collision_mesh_with_defaults ( Gfx * gfx)

Recursive search for vtx and set surfaceTypes to -1 and sectionId's to 0xFF

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_surface_type()

s8 get_surface_type ( u16 index)
Here is the caller graph for this function:

◆ get_track_section_id()

s16 get_track_section_id ( u16 index)
Here is the caller graph for this function:

◆ is_line_intersecting_rectangle()

s32 is_line_intersecting_rectangle ( s16 minX,
s16 maxX,
s16 minZ,
s16 maxZ,
s16 x1,
s16 z1,
s16 x2,
s16 z2 )
Returns
1 intersecting triangle, 0 not intersecting.
Here is the caller graph for this function:

◆ is_triangle_intersecting_bounding_box()

s32 is_triangle_intersecting_bounding_box ( s16 minX,
s16 maxX,
s16 minZ,
s16 maxZ,
u16 index )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nullify_displaylist()

void nullify_displaylist ( uintptr_t addr)
Here is the caller graph for this function:

◆ player_terrain_collision()

u16 player_terrain_collision ( Player * player,
KartTyre * tyre,
f32 tyre2X,
f32 tyre2Y,
f32 tyre2Z )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_shell_collision()

void process_shell_collision ( Vec3f ,
f32 ,
Vec3f ,
f32  )

◆ set_vertex_colours()

void set_vertex_colours ( uintptr_t ,
u32 ,
s32 ,
s8 ,
u8 ,
u8 ,
u8  )

◆ set_vtx_buffer()

void set_vtx_buffer ( uintptr_t addr,
u32 numVertices,
u32 bufferIndex )

Generates a list of pointers to course vtx.

Here is the caller graph for this function:

◆ shell_collision()

void shell_collision ( Collision * collision,
Vec3f velocity )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ spawn_actor_on_surface()

f32 spawn_actor_on_surface ( f32 posX,
f32 posY,
f32 posZ )

If unable to spawn actor on the surface set to -3000.0f or if outside the collision grid, spawn in the air (3000.0f).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subtract_scaled_vector()

void subtract_scaled_vector ( Vec3f pos1,
f32 boundingBoxSize,
Vec3f pos2 )
Here is the caller graph for this function: