Mario Kart 64
|
#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include <path.h>
#include <course.h>
#include "main.h"
#include "cpu_vehicles_camera_path.h"
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) |
void adjust_path_at_start_line | ( | UNUSED f32 | posX, |
UNUSED f32 | posY, | ||
f32 | posZ, | ||
s16 * | pathPointIndex, | ||
s32 | pathIndex ) |
void calculate_track_offset_position | ( | u16 | pathPointIndex, |
f32 | lerpFactor, | ||
f32 | offsetDistance, | ||
s16 | 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
posX | Player's X position |
posZ | Player's Z position |
pathPointIndex | Current pathPoint index |
pathIndex | Current path/track index |
s16 find_closest_pathPoint_track_section | ( | f32 | posX, |
f32 | posY, | ||
f32 | posZ, | ||
u16 | trackSectionId, | ||
s32 * | pathIndex ) |
s16 func_8000D6D0 | ( | Vec3f | position, |
s16 * | pathPointIndex, | ||
f32 | speed, | ||
f32 | arg3, | ||
s16 | pathIndex, | ||
s16 | arg5 ) |
Calculates an interpolated position between left and right track paths.
currentPathPoint | Index of the current pathPoint |
trackOffset | Value between 0.0 and 1.0 determining position between left (0.0) and right (1.0) path |
pathIndex | Index of the track/path segment |
void tweak_path_index_wario_stadium | ( | UNUSED f32 | posX, |
f32 | posY, | ||
UNUSED f32 | posZ, | ||
s16 * | pathPointIndex, | ||
UNUSED s32 | arg4 ) |
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?
s16 update_path_index_track_section | ( | f32 | posX, |
f32 | posY, | ||
f32 | posZ, | ||
Player * | player, | ||
s32 | playerId, | ||
s32 * | pathIndex ) |
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
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
posX | Current X position |
posY | Current Y position |
posZ | Current Z position |
pathPointIndex | Current pathPoint index |
player | Pointer to player structure |
playerId | Player's ID |
pathIndex | Current track path index |