Mario Kart 64
Loading...
Searching...
No Matches
path_utils.inc.c File Reference
#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include <path.h>
#include <course.h>
#include "main.h"
#include "cpu_vehicles_camera_path.h"
Include dependency graph for path_utils.inc.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool are_in_curve (UNUSED s32 arg0, u16 pathPointIndex)
 
bool is_far_from_path (s32 playerIndex)
 
f32 calculate_track_position_factor (f32 posX, f32 posZ, u16 pathPointIndex, s32 pathIndex)
 
void update_player_position_factor (s32 playerId, u16 pathPointIndex, s32 pathIndex)
 
void calculate_track_offset_position (u16 pathPointIndex, f32 lerpFactor, f32 offsetDistance, s16 pathIndex)
 
void set_track_offset_position (u16 pathPointIndex, f32 trackOffset, s16 pathIndex)
 
s16 func_8000BD94 (f32 posX, f32 posY, f32 posZ, s32 pathIndex)
 
s16 find_closest_pathPoint_track_section (f32 posX, f32 posY, f32 posZ, u16 trackSectionId, s32 *pathIndex)
 
s16 update_path_index_with_track (f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex, u16 trackSectionId)
 
s16 update_path_index (f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex)
 
void tweak_path_index_wario_stadium (UNUSED f32 posX, f32 posY, UNUSED f32 posZ, s16 *pathPointIndex, UNUSED s32 arg4)
 
void adjust_path_at_start_line (UNUSED f32 posX, UNUSED f32 posY, f32 posZ, s16 *pathPointIndex, s32 pathIndex)
 
s16 update_path_index_track_section (f32 posX, f32 posY, f32 posZ, Player *player, s32 playerId, s32 *pathIndex)
 
s16 update_player_path (f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, Player *player, s32 playerId, s32 pathIndex)
 
s16 find_closest_vehicles_pathPoint (f32 xPos, UNUSED f32 yPos, f32 zPos, s16 pathPointIndex)
 
s16 func_8000D24C (f32 posX, f32 posY, f32 posZ, s32 *pathIndex)
 
s16 func_8000D2B4 (f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex)
 
s16 func_8000D33C (f32 posX, f32 posY, f32 posZ, s16 pathPointIndex, s32 pathIndex)
 
f32 cpu_track_position_factor (s32 playerId)
 
void determine_ideal_cpu_position_offset (s32 playerId, u16 pathPoint)
 
s16 func_8000D6D0 (Vec3f position, s16 *pathPointIndex, f32 speed, f32 arg3, s16 pathIndex, s16 arg5)
 
s16 func_8000D940 (Vec3f pos, s16 *pathPointIndex, f32 speed, f32 arg3, s16 pathIndex)
 
s16 update_vehicle_following_path (Vec3f pos, s16 *pathPointIndex, f32 speed)
 

Function Documentation

◆ adjust_path_at_start_line()

void adjust_path_at_start_line ( UNUSED f32 posX,
UNUSED f32 posY,
f32 posZ,
s16 * pathPointIndex,
s32 pathIndex )
Here is the caller graph for this function:

◆ are_in_curve()

bool are_in_curve ( UNUSED s32 arg0,
u16 pathPointIndex )

◆ calculate_track_offset_position()

void calculate_track_offset_position ( u16 pathPointIndex,
f32 lerpFactor,
f32 offsetDistance,
s16 pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate_track_position_factor()

f32 calculate_track_position_factor ( f32 posX,
f32 posZ,
u16 pathPointIndex,
s32 pathIndex )

Calculates a factor representing where the player is positioned between left and right track boundaries Returns a value between -1.0 and 1.0: -1.0 = On the left boundary 0.0 = In the middle of the track 1.0 = On the right boundary

Parameters
posXPlayer's X position
posZPlayer's Z position
pathPointIndexCurrent pathPoint index
pathIndexCurrent path/track index
Returns
Position factor between track boundaries
Here is the caller graph for this function:

◆ cpu_track_position_factor()

f32 cpu_track_position_factor ( s32 playerId)
Here is the caller graph for this function:

◆ determine_ideal_cpu_position_offset()

void determine_ideal_cpu_position_offset ( s32 playerId,
u16 pathPoint )
Here is the call graph for this function:

◆ find_closest_pathPoint_track_section()

s16 find_closest_pathPoint_track_section ( f32 posX,
f32 posY,
f32 posZ,
u16 trackSectionId,
s32 * pathIndex )
Here is the caller graph for this function:

◆ find_closest_vehicles_pathPoint()

s16 find_closest_vehicles_pathPoint ( f32 xPos,
UNUSED f32 yPos,
f32 zPos,
s16 pathPointIndex )
Here is the caller graph for this function:

◆ func_8000BD94()

s16 func_8000BD94 ( f32 posX,
f32 posY,
f32 posZ,
s32 pathIndex )
Here is the caller graph for this function:

◆ func_8000D24C()

s16 func_8000D24C ( f32 posX,
f32 posY,
f32 posZ,
s32 * pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_8000D2B4()

s16 func_8000D2B4 ( f32 posX,
f32 posY,
f32 posZ,
s16 pathPointIndex,
s32 pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_8000D33C()

s16 func_8000D33C ( f32 posX,
f32 posY,
f32 posZ,
s16 pathPointIndex,
s32 pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_8000D6D0()

s16 func_8000D6D0 ( Vec3f position,
s16 * pathPointIndex,
f32 speed,
f32 arg3,
s16 pathIndex,
s16 arg5 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_8000D940()

s16 func_8000D940 ( Vec3f pos,
s16 * pathPointIndex,
f32 speed,
f32 arg3,
s16 pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_far_from_path()

bool is_far_from_path ( s32 playerIndex)
Here is the caller graph for this function:

◆ set_track_offset_position()

void set_track_offset_position ( u16 pathPointIndex,
f32 trackOffset,
s16 pathIndex )

Calculates an interpolated position between left and right track paths.

Parameters
currentPathPointIndex of the current pathPoint
trackOffsetValue between 0.0 and 1.0 determining position between left (0.0) and right (1.0) path
pathIndexIndex of the track/path segment
Here is the caller graph for this function:

◆ tweak_path_index_wario_stadium()

void tweak_path_index_wario_stadium ( UNUSED f32 posX,
f32 posY,
UNUSED f32 posZ,
s16 * pathPointIndex,
UNUSED s32 arg4 )
Here is the caller graph for this function:

◆ update_path_index()

s16 update_path_index ( f32 posX,
f32 posY,
f32 posZ,
s16 pathPointIndex,
s32 pathIndex )

Tries to find the pathPoint nearest to (posX, posY, posZ) Only considers path within 400 units of (posX, posY, posZ) Looks 3 path behind and 6 path ahead of pathPointIndex

This fake match is done to stop the compiler from optimzing out considerPathPoint. Maybe if no pathPoint was found some debugging info was printed out, but come production time they removed the debug printing but not the loop?

Here is the caller graph for this function:

◆ update_path_index_track_section()

s16 update_path_index_track_section ( f32 posX,
f32 posY,
f32 posZ,
Player * player,
s32 playerId,
s32 * pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_path_index_with_track()

s16 update_path_index_with_track ( f32 posX,
f32 posY,
f32 posZ,
s16 pathPointIndex,
s32 pathIndex,
u16 trackSectionId )

Tries to find the pathPoint nearest to (posX, posY, posZ) Only consider path in the same segment as trackSectionId Only considers path within 500 units of(posX, posY, posZ) Looks 3 path behind and 6 path ahead of pathPointIndex

Here is the caller graph for this function:

◆ update_player_path()

s16 update_player_path ( f32 posX,
f32 posY,
f32 posZ,
s16 pathPointIndex,
Player * player,
s32 playerId,
s32 pathIndex )

Updates and validates a player's pathPoint position on the track Handles different logic for human players vs AI, and includes recovery mechanisms

Parameters
posXCurrent X position
posYCurrent Y position
posZCurrent Z position
pathPointIndexCurrent pathPoint index
playerPointer to player structure
playerIdPlayer's ID
pathIndexCurrent track path index
Returns
New pathPoint index or -1 if invalid
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_player_position_factor()

void update_player_position_factor ( s32 playerId,
u16 pathPointIndex,
s32 pathIndex )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_vehicle_following_path()

s16 update_vehicle_following_path ( Vec3f pos,
s16 * pathPointIndex,
f32 speed )
Here is the call graph for this function:
Here is the caller graph for this function: