Mario Kart 64
Loading...
Searching...
No Matches
collision.c File Reference
#include <ultra64.h>
#include <macros.h>
#include <PR/gbi.h>
#include <mk64.h>
#include <common_structs.h>
#include <actor_types.h>
#include "main.h"
#include "memory.h"
#include "collision.h"
#include "math_util.h"
#include "code_800029B0.h"
Include dependency graph for collision.c:

Functions

void nullify_displaylist (uintptr_t addr)
 
void func_802AAAAC (Collision *collision)
 
f32 func_802AAB4C (Player *player)
 
s32 func_802AAE4C (Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, f32 posZ, u16 index)
 
s32 func_802AB288 (Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, f32 posZ, u16 index)
 
s32 func_802AB6C4 (Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, f32 posZ, u16 index)
 
s32 func_802ABB04 (f32 posX, f32 posZ, u16 index)
 
s8 get_surface_type (u16 index)
 
s16 func_802ABD40 (u16 index)
 
s16 func_802ABD7C (u16 index)
 
s16 func_802ABDB8 (u16 index)
 
s16 func_802ABDF4 (u16 index)
 
f32 func_802ABE30 (f32 x, f32 y, f32 z, u16 index)
 
f32 func_802ABEAC (Collision *collision, Vec3f pos)
 
void process_shell_collision (Vec3f pos, UNUSED f32 boundingBoxSize, Vec3f velocity, UNUSED f32 unk)
 
void shell_collision (Collision *collision, Vec3f velocity)
 
void func_802AC114 (Vec3f pos1, f32 boundingBoxSize, Vec3f pos2, UNUSED f32 unk)
 
s32 func_802AC22C (KartBoundingBoxCorner *arg0)
 
s32 is_colliding_with_drivable_surface (Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 index, f32 posX, f32 posY, f32 posZ)
 
s32 is_colliding_with_wall2 (Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 arg5, f32 arg6, f32 arg7, f32 arg8)
 
s32 is_colliding_with_wall1 (Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 arg5, f32 arg6, f32 arg7, f32 arg8)
 
u16 func_802AD950 (Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2)
 
u16 func_802ADDC8 (Collision *collision, f32 boundingBoxSize, f32 posX, f32 posY, f32 posZ)
 
f32 func_802AE1C0 (f32 posX, f32 posY, f32 posZ)
 
void func_802AE434 (Vtx *vtx1, Vtx *vtx2, Vtx *vtx3, s8 surfaceType, u16 sectionId)
 
void set_vtx_from_triangle (u32 triangle, s8 surfaceType, u16 sectionId)
 
void set_vtx_from_tri2 (u32 triangle1, u32 triangle2, s8 surfaceType, u16 sectionId)
 
void set_vtx_from_quadrangle (u32 line, s8 surfaceType, u16 sectionId)
 
void set_vtx_buffer (uintptr_t addr, u32 numVertices, u32 bufferIndex)
 
s32 is_line_intersecting_rectangle (s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 x1, s16 z1, s16 x2, s16 z2)
 
s32 is_triangle_intersecting_bounding_box (s16 minX, s16 maxX, s16 minZ, s16 maxZ, u16 index)
 
void func_802AF314 (void)
 
void set_vertex_data_with_defaults (Gfx *gfx)
 
void set_vertex_data_with_default_section_id (Gfx *gfx, s8 surfaceType)
 
void find_and_set_vertex_data (Gfx *addr, s8 surfaceType, u16 sectionId)
 
void find_and_set_tile_size (uintptr_t addr, s32 uls, s32 ult)
 
void set_vertex_colours (uintptr_t addr, u32 vertexCount, UNUSED s32 vert3, s8 alpha, u8 red, u8 green, u8 blue)
 
void find_vtx_and_set_colours (uintptr_t displayList, s8 alpha, u8 red, u8 green, u8 blue)
 
void subtract_scaled_vector (Vec3f pos1, f32 boundingBoxSize, Vec3f pos2)
 
u16 process_collision (Player *player, KartBoundingBoxCorner *corner, f32 cornerPosX, f32 cornerPosY, f32 cornerPosZ)
 

Variables

u8 D_8014F1110
 
u32 D_8015F58C
 

Function Documentation

◆ 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_and_set_vertex_data()

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

Recursive search and set for vertex data

Here is the call graph for this function:
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_802AAE4C()

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

◆ func_802AB288()

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

◆ func_802AB6C4()

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

◆ func_802ABB04()

s32 func_802ABB04 ( f32 posX,
f32 posZ,
u16 index )
Here is the caller graph for this function:

◆ func_802ABD40()

s16 func_802ABD40 ( u16 index)
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_802ABE30()

f32 func_802ABE30 ( f32 x,
f32 y,
f32 z,
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:

◆ func_802AC114()

void func_802AC114 ( Vec3f pos1,
f32 boundingBoxSize,
Vec3f pos2,
UNUSED f32 unk )

Adjusts the position of pos2 based on pos1 but in the orthogonal direction to pos2.

Here is the caller graph for this function:

◆ func_802AC22C()

s32 func_802AC22C ( KartBoundingBoxCorner * arg0)
Here is the call graph for this function:

◆ func_802AD950()

u16 func_802AD950 ( Collision * collision,
f32 boundingBoxSize,
f32 x1,
f32 y1,
f32 z1,
f32 x2,
f32 y2,
f32 z2 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_802ADDC8()

u16 func_802ADDC8 ( 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:

◆ func_802AE1C0()

f32 func_802AE1C0 ( f32 posX,
f32 posY,
f32 posZ )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_802AE434()

void func_802AE434 ( Vtx * vtx1,
Vtx * vtx2,
Vtx * vtx3,
s8 surfaceType,
u16 sectionId )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_802AF314()

void func_802AF314 ( void )

Appears to initialize some variables and struct members after course displaylists have been parsed.

Bug
possibly bug. Allocate memory but not increment the pointer. This is bad, dumb code, and more importantly it's bad dumb code that doesn't make any sense here. It is incremented after this function completes using a different variable. Not good.
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:

◆ is_colliding_with_drivable_surface()

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

◆ is_colliding_with_wall1()

s32 is_colliding_with_wall1 ( Collision * arg,
f32 boundingBoxSize,
f32 x1,
f32 y1,
f32 z1,
u16 arg5,
f32 arg6,
f32 arg7,
f32 arg8 )

This is actually more like colliding with face X/Y/Z

Here is the caller graph for this function:

◆ is_colliding_with_wall2()

s32 is_colliding_with_wall2 ( Collision * arg,
f32 boundingBoxSize,
f32 x1,
f32 y1,
f32 z1,
u16 arg5,
f32 arg6,
f32 arg7,
f32 arg8 )

Wall collision

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:

◆ process_collision()

u16 process_collision ( Player * player,
KartBoundingBoxCorner * corner,
f32 cornerPosX,
f32 cornerPosY,
f32 cornerPosZ )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_shell_collision()

void process_shell_collision ( Vec3f pos,
UNUSED f32 boundingBoxSize,
Vec3f velocity,
UNUSED f32 unk )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_vertex_colours()

void set_vertex_colours ( uintptr_t addr,
u32 vertexCount,
UNUSED s32 vert3,
s8 alpha,
u8 red,
u8 green,
u8 blue )
Here is the caller graph for this function:

◆ set_vertex_data_with_default_section_id()

void set_vertex_data_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:

◆ set_vertex_data_with_defaults()

void set_vertex_data_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:

◆ 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:

◆ set_vtx_from_quadrangle()

void set_vtx_from_quadrangle ( u32 line,
s8 surfaceType,
u16 sectionId )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_vtx_from_tri2()

void set_vtx_from_tri2 ( u32 triangle1,
u32 triangle2,
s8 surfaceType,
u16 sectionId )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_vtx_from_triangle()

void set_vtx_from_triangle ( u32 triangle,
s8 surfaceType,
u16 sectionId )

Triangle contains three indices that are used to get the actual vertices.

Here is the call graph for this function:
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:

◆ subtract_scaled_vector()

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

Variable Documentation

◆ D_8014F1110

u8 D_8014F1110
extern

◆ D_8015F58C

u32 D_8015F58C
extern