mirror of
https://github.com/n64decomp/mk64
synced 2026-05-23 22:45:21 -04:00
Document Vehicles (#641)
* start doc collision * fix merge * finish rename fonction related to vehicle * document around waypoint of vehicle * make some modification * make some change and rename one * copy_ to oldPos * doc smoke ferry and train * some rename * fix some renaming * precise index * rename a funciton * simplify waypoint_vehicles * change some name * change some name * rename move_to_point_direction * fix some conflict * Update code_80005FD0.c * Update code_80005FD0.h --------- Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
@@ -4181,7 +4181,7 @@ TrackWaypoint d_course_dks_jungle_parkway_unknown_waypoints[] = {
|
||||
{-32768, 0, 0, 0},
|
||||
};
|
||||
|
||||
TrackWaypoint d_course_dks_jungle_parkway_unknown_waypoints2[] = {
|
||||
TrackWaypoint d_course_dks_jungle_parkway_ferry_waypoints[] = {
|
||||
{1237, 0, -1373, 0},
|
||||
{1206, 0, -1365, 0},
|
||||
{877, 0, -1272, 0},
|
||||
|
||||
@@ -113,6 +113,7 @@ extern Gfx d_course_dks_jungle_parkway_dl_7008[];
|
||||
extern Gfx d_course_dks_jungle_parkway_dl_7080[];
|
||||
extern Gfx d_course_dks_jungle_parkway_dl_7108[];
|
||||
extern TrackWaypoint d_course_dks_jungle_parkway_unknown_waypoints[];
|
||||
extern TrackWaypoint d_course_dks_jungle_parkway_ferry_waypoints[];
|
||||
extern TrackWaypoint d_course_dks_jungle_parkway_track_waypoints[];
|
||||
extern Vtx d_course_dks_jungle_parkway_paddle_boat_model1[];
|
||||
extern Vtx d_course_dks_jungle_parkway_paddle_boat_model2[];
|
||||
|
||||
@@ -3801,7 +3801,7 @@ TrackWaypoint d_course_kalimari_desert_unknown_waypoints[] = {
|
||||
{-32768, 0, 0, 0},
|
||||
};
|
||||
|
||||
TrackWaypoint d_course_kalimari_desert_track_unknown_waypoints[] = {
|
||||
TrackWaypoint d_course_kalimari_desert_train_waypoints[] = {
|
||||
{-741, 0, 2114, 0},
|
||||
{-741, 0, 2130, 0},
|
||||
{-741, 0, 2364, 0},
|
||||
|
||||
@@ -88,7 +88,7 @@ extern Gfx d_course_kalimari_desert_dl_66F0[];
|
||||
extern Gfx d_course_kalimari_desert_dl_6838[];
|
||||
extern Gfx d_course_kalimari_desert_dl_6940[];
|
||||
extern TrackWaypoint d_course_kalimari_desert_unknown_waypoints[];
|
||||
extern TrackWaypoint d_course_kalimari_desert_track_unknown_waypoints[];
|
||||
extern TrackWaypoint d_course_kalimari_desert_train_waypoints[];
|
||||
extern TrackWaypoint d_course_kalimari_desert_track_waypoints[];
|
||||
extern u8 d_course_kalimari_desert_tree_tlut[];
|
||||
extern Vtx d_course_kalimari_desert_cactus_model1[];
|
||||
|
||||
@@ -263,9 +263,7 @@ typedef struct {
|
||||
/* 0x0010 */ s16 currentItemCopy; // Has no effect on what item the players has, It is just a synced copy
|
||||
/* 0x0012 */ s16 unk_012;
|
||||
/* 0x0014 */ Vec3f pos;
|
||||
/* 0x0020 */ f32 copy_rotation_x;
|
||||
/* 0x0024 */ f32 copy_rotation_y;
|
||||
/* 0x0028 */ f32 copy_rotation_z;
|
||||
/* 0x0020 */ Vec3f oldPos;
|
||||
/* 0x002C */ Vec3s rotation;
|
||||
/* 0x0032 */ char unk_032[0x2];
|
||||
/* 0x0034 */ Vec3f velocity;
|
||||
|
||||
+3
-3
@@ -49,7 +49,7 @@ typedef struct {
|
||||
/* 0x000 */ TrainCarStuff locomotive;
|
||||
/* 0x024 */ TrainCarStuff tender;
|
||||
/* 0x048 */ TrainCarStuff passengerCars[NUM_PASSENGER_CAR_ENTRIES];
|
||||
/* 0x0FC */ f32 someMultiplier;
|
||||
/* 0x0FC */ f32 speed;
|
||||
/* 0x100 */ s32 someFlags;
|
||||
/* 0x104 */ s32 numCars; // Non-locomotive car count?
|
||||
/* 0x108 */ s32 unused; // Not read or written. Could be padding?
|
||||
@@ -62,7 +62,7 @@ typedef struct {
|
||||
/* 0x10 */ Vec3f velocity; //
|
||||
/* 0x1C */ u16 waypointIndex; //
|
||||
/* 0x1E */ s16 actorIndex; //
|
||||
/* 0x20 */ f32 someMultiplier; //
|
||||
/* 0x20 */ f32 speed; //
|
||||
/* 0x24 */ s16 rotY; // Only Y rotation is tracked in this struct
|
||||
/* 0x26 */ // s16 compilerPadding2;
|
||||
/**
|
||||
@@ -79,7 +79,7 @@ typedef struct {
|
||||
/* 0x10 */ Vec3f velocity;
|
||||
/* 0x1C */ u16 waypointIndex;
|
||||
/* 0x1E */ s16 actorIndex;
|
||||
/* 0x20 */ f32 someMultiplier; //
|
||||
/* 0x20 */ f32 speed; //
|
||||
/* 0x24 */ f32 someMultiplierTheSequel; //
|
||||
/* 0x28 */ Vec3s rotation;
|
||||
/* 0x2E */ s16 someType; //
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ typedef struct {
|
||||
/* 0x00 */ s16 posX;
|
||||
/* 0x02 */ s16 posY;
|
||||
/* 0x04 */ s16 posZ;
|
||||
/* 0x06 */ u16 trackSegment;
|
||||
/* 0x06 */ u16 trackSectionId;
|
||||
} TrackWaypoint; // size = 0x08
|
||||
|
||||
/**
|
||||
|
||||
+315
-311
File diff suppressed because it is too large
Load Diff
+30
-30
@@ -56,13 +56,13 @@ typedef struct {
|
||||
typedef struct {
|
||||
s16 x;
|
||||
s16 z;
|
||||
} PathNoY;
|
||||
} Path2D;
|
||||
|
||||
/* Function Prototypes */
|
||||
s16 func_80005FD0(Vec3f, Vec3f);
|
||||
s16 get_angle_between_waypoints(Vec3f, Vec3f);
|
||||
|
||||
s32 func_80006018(f32, f32, f32, f32, f32, f32, f32, f32);
|
||||
void func_80006114(Vec3f, Vec3f, s16);
|
||||
void adjust_position_by_angle(Vec3f, Vec3f, s16);
|
||||
s32 set_vehicle_render_distance_flags(Vec3f, f32, s32);
|
||||
void func_800065D0(s32, Player*);
|
||||
void set_places(void);
|
||||
@@ -97,15 +97,15 @@ void func_8000BA14(u16, f32, f32, s16);
|
||||
void func_8000BBD8(u16, f32, s16);
|
||||
s16 func_8000BD94(f32, f32, f32, s32);
|
||||
|
||||
s16 func_8000C0BC(f32, f32, f32, u16, s32*);
|
||||
s16 find_closest_waypoint_track_segment(f32, f32, f32, u16, s32*);
|
||||
s16 func_8000C884(f32, f32, f32, s16, s32, u16);
|
||||
s16 func_8000C9DC(f32, f32, f32, s16, s32);
|
||||
s16 find_closest_waypoint_with_previous_waypoint(f32, f32, f32, s16, s32);
|
||||
void func_8000CBA4(f32, f32, f32, s16*, s32);
|
||||
void func_8000CBF8(f32, f32, f32, s16*, s32);
|
||||
s16 func_8000CC88(f32, f32, f32, Player*, s32, s32*);
|
||||
s16 func_8000CD24(f32, f32, f32, s16, Player*, s32, s32);
|
||||
|
||||
s16 func_8000D100(f32, f32, f32, s16);
|
||||
s16 find_closest_vehicles_waypoint(f32, f32, f32, s16);
|
||||
s16 func_8000D24C(f32, f32, f32, s32*);
|
||||
s16 func_8000D2B4(f32, f32, f32, s16, s32);
|
||||
s16 func_8000D33C(f32, f32, f32, s16, s32);
|
||||
@@ -113,7 +113,7 @@ f32 func_8000D3B8(s32);
|
||||
void func_8000D438(s32, u16);
|
||||
s16 func_8000D6D0(Vec3f, s16*, f32, f32, s16, s16);
|
||||
s16 func_8000D940(Vec3f, s16*, f32, f32, s16);
|
||||
s16 func_8000DBAC(Vec3f, s16*, f32);
|
||||
s16 update_vehicle_following_waypoint(Vec3f, s16*, f32);
|
||||
void set_bomb_kart_spawn_positions(void);
|
||||
void func_8000DF8C(s32);
|
||||
|
||||
@@ -143,7 +143,7 @@ f32 func_80010FA0(f32, f32, f32, s32, s32);
|
||||
|
||||
s32 func_80011014(TrackWaypoint *, TrackWaypoint *, s32, s32);
|
||||
s32 process_path_data(TrackWaypoint*, TrackWaypoint*);
|
||||
s32 func_8001168C(PathNoY*, TrackWaypoint*, s32);
|
||||
s32 generate_2d_path(Path2D*, TrackWaypoint*, s32);
|
||||
void copy_courses_kart_ai_behaviour(void);
|
||||
void reset_kart_ai_behaviour_none(s32);
|
||||
void reset_kart_ai_behaviour(s32);
|
||||
@@ -152,42 +152,42 @@ void kart_ai_behaviour_end(s32, Player*);
|
||||
void kart_ai_behaviour(s32);
|
||||
void func_80011EC0(s32, Player*, s32, u16);
|
||||
|
||||
void func_800120C8(void);
|
||||
void func_80012190(void);
|
||||
void func_80012220(VehicleStuff*);
|
||||
void init_course_vehicles(void);
|
||||
void func_80012780(TrainCarStuff*, PathNoY *, u16);
|
||||
void func_800127E0(void);
|
||||
void func_80012A48(TrainCarStuff*, s16);
|
||||
void generate_train_waypoints(void);
|
||||
void generate_ferry_waypoints(void);
|
||||
void spawn_vehicle_on_road(VehicleStuff*);
|
||||
void spawn_course_vehicles(void);
|
||||
void set_vehicle_pos_waypoint(TrainCarStuff*, Path2D*, u16);
|
||||
void init_vehicles_trains(void);
|
||||
void sync_train_components(TrainCarStuff*, s16);
|
||||
void update_vehicle_trains(void);
|
||||
void func_80012DC0(s32, Player*);
|
||||
|
||||
void func_80013054(void);
|
||||
void check_ai_crossing_distance(s32);
|
||||
void func_800132F4(void);
|
||||
void init_vehicles_ferry(void);
|
||||
void update_vehicle_paddle_boats(void);
|
||||
void func_80013854(Player*);
|
||||
void func_800139E4(f32, f32, s32, s32, VehicleStuff*, TrackWaypoint*);
|
||||
void initialize_toads_turnpike_vehicle(f32, f32, s32, s32, VehicleStuff*, TrackWaypoint*);
|
||||
f32 func_80013C74(s16, s16);
|
||||
void func_80013D20(VehicleStuff*);
|
||||
void update_vehicle_follow_waypoint(VehicleStuff*);
|
||||
void func_80013F7C(s32, Player*, VehicleStuff*, f32, f32, s32, u32);
|
||||
|
||||
f32 func_800145A8(s16, f32, s16);
|
||||
void func_800146B8(s32, s32, VehicleStuff*);
|
||||
void func_800147E0(void);
|
||||
void func_8001487C(void);
|
||||
void init_vehicles_box_trucks(void);
|
||||
void update_vehicle_box_trucks(void);
|
||||
void func_800148C4(s32, Player*);
|
||||
void func_8001490C(s32);
|
||||
void func_80014934(void);
|
||||
void func_800149D0(void);
|
||||
void init_vehicles_school_buses(void);
|
||||
void update_vehicle_school_bus(void);
|
||||
void func_80014A18(s32, Player*);
|
||||
void func_80014A60(s32);
|
||||
void func_80014A88(void);
|
||||
void func_80014B24(void);
|
||||
void init_vehicles_trucks(void);
|
||||
void update_vehicle_tanker_trucks(void);
|
||||
void func_80014B6C(s32, Player*);
|
||||
void func_80014BB4(s32);
|
||||
void func_80014BDC(void);
|
||||
void func_80014C78(void);
|
||||
void init_vehicles_cars(void);
|
||||
void update_vehicle_cars(void);
|
||||
void func_80014CC0(s32, Player*);
|
||||
void func_80014D08(s32);
|
||||
void func_80014D30(s32, s32);
|
||||
@@ -264,7 +264,7 @@ extern s16 D_80162F50[];
|
||||
extern Vec3f D_80162FA0;
|
||||
extern Vec3f D_80162FB0;
|
||||
extern Vec3f D_80162FC0;
|
||||
extern s16 D_80162FCC;
|
||||
extern s16 gTrainSmokeTimer;
|
||||
extern s16 D_80162FD0;
|
||||
extern f32 gCourseCompletionPercentByRank[]; // D_80162FD8
|
||||
extern s16 D_80162FF8[];
|
||||
@@ -277,7 +277,7 @@ extern s32 D_801630B8[];
|
||||
extern u16 D_801630E0;
|
||||
extern s16 D_801630E2;
|
||||
extern s16 D_801630E8[];
|
||||
extern s16 D_801630FC;
|
||||
extern s16 gFerrySmokeTimer;
|
||||
extern s32 D_80163100[];
|
||||
extern s32 D_80163128[];
|
||||
extern s32 D_80163150[];
|
||||
@@ -357,8 +357,8 @@ extern s16 D_801634EC;
|
||||
extern s32 D_801634F0;
|
||||
extern s32 D_801634F4;
|
||||
extern Test D_801634F8[];
|
||||
extern PathNoY *D_80163598;
|
||||
extern s32 D_8016359C;
|
||||
extern Path2D *gVehicle2DWaypoint;
|
||||
extern s32 gVehicle2DWaypointLength;
|
||||
extern u16 isCrossingTriggeredByIndex[];
|
||||
extern u16 sCrossingActiveTimer[];
|
||||
extern s32 D_80163DD8[];
|
||||
|
||||
+9
-2
@@ -310,11 +310,18 @@ s32 gObjectParticle1[gObjectParticle2_SIZE];
|
||||
Collision D_8018C3B0;
|
||||
/**
|
||||
* List of object list indices used for:
|
||||
* Bats in Banshee's Boardwalk (but only 1 player mode?)
|
||||
* - Bats in Banshee's Boardwalk (but only 1 player mode?)
|
||||
* - Train index 0 smoke in Kalimari Desert
|
||||
* - Ferry index 0 smoke in DK Jungle
|
||||
*/
|
||||
s32 gObjectParticle2[gObjectParticle2_SIZE];
|
||||
// Maybe some unused Collision?
|
||||
UNUSED Collision D_8018C5F0;
|
||||
/**
|
||||
* List of object list indices used for:
|
||||
* - Train index 1 smoke in Kalimari Desert
|
||||
* - Ferry index 1 smoke in DK Jungle
|
||||
*/
|
||||
s32 gObjectParticle3[gObjectParticle3_SIZE];
|
||||
Collision D_8018C830;
|
||||
/**
|
||||
@@ -760,7 +767,7 @@ void render_object_for_player(s32 cameraId) {
|
||||
case COURSE_TOADS_TURNPIKE:
|
||||
break;
|
||||
case COURSE_KALAMARI_DESERT:
|
||||
render_object_train_smoke_particles(cameraId);
|
||||
render_object_trains_smoke_particles(cameraId);
|
||||
break;
|
||||
case COURSE_SHERBET_LAND:
|
||||
if (gGamestate != CREDITS_SEQUENCE) {
|
||||
|
||||
+2
-2
@@ -1415,11 +1415,11 @@ UNUSED void func_8008A850(s32 arg0) {
|
||||
}
|
||||
|
||||
UNUSED s32 func_8008A870(Player *player) {
|
||||
return get_section_id(player->collision.meshIndexZX);
|
||||
return get_track_section_id(player->collision.meshIndexZX);
|
||||
}
|
||||
|
||||
s32 func_8008A890(Camera *camera) {
|
||||
return get_section_id(camera->collision.meshIndexZX);
|
||||
return get_track_section_id(camera->collision.meshIndexZX);
|
||||
}
|
||||
|
||||
s32 func_8008A8B0(s16 arg0, s16 arg1) {
|
||||
|
||||
+1
-1
@@ -1897,7 +1897,7 @@ void func_80090970(Player *player, s8 playerId, s8 arg2) {
|
||||
player->unk_0CA &= ~0x0001;
|
||||
}
|
||||
} else {
|
||||
move_f32_towards(&player->pos[1], player->copy_rotation_y + 40.0f, 0.02f);
|
||||
move_f32_towards(&player->pos[1], player->oldPos[1] + 40.0f, 0.02f);
|
||||
player->unk_0C6 -= 8;
|
||||
if (player->unk_0C6 < 9) {
|
||||
player->unk_0C6 = 0;
|
||||
|
||||
+51
-54
@@ -873,9 +873,9 @@ void func_8002934C(Player *player, Camera *camera, s8 screenId, s8 playerId) {
|
||||
}
|
||||
else {
|
||||
if (((player->animFrameSelector[screenId]) >= 0) && ((player->animFrameSelector[screenId]) < 0x101)) {
|
||||
var_f0 = player->copy_rotation_y - player->pos[1];
|
||||
var_f0 = player->oldPos[1] - player->pos[1];
|
||||
} else {
|
||||
var_f0 = player->pos[1] - player->copy_rotation_y;
|
||||
var_f0 = player->pos[1] - player->oldPos[1];
|
||||
}
|
||||
player->unk_0D4[screenId] = (s16) ((s32) (((f64) func_802B7C40(var_f0 / temp_f2)) * 0.5));
|
||||
}
|
||||
@@ -1028,8 +1028,7 @@ void func_80029B4C(Player *player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) {
|
||||
player->tyres[FRONT_LEFT].pos[0] = player->pos[0] + sp8C[0];
|
||||
player->tyres[FRONT_LEFT].pos[1] = player->pos[1] + sp8C[1];
|
||||
player->tyres[FRONT_LEFT].pos[2] = player->pos[2] + sp8C[2];
|
||||
process_collision(player, &player->tyres[FRONT_LEFT], sp80[0], sp80[1], sp80[2]);
|
||||
|
||||
player_terrain_collision(player, &player->tyres[FRONT_LEFT], sp80[0], sp80[1], sp80[2]);
|
||||
sp8C[0] = (-var_f12) + 3.6;
|
||||
sp8C[1] = -player->boundingBoxSize;
|
||||
sp8C[2] = var_f12 - 2.0f;
|
||||
@@ -1040,7 +1039,7 @@ void func_80029B4C(Player *player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) {
|
||||
player->tyres[FRONT_RIGHT].pos[0] = player->pos[0] + sp8C[0];
|
||||
player->tyres[FRONT_RIGHT].pos[1] = player->pos[1] + sp8C[1];
|
||||
player->tyres[FRONT_RIGHT].pos[2] = player->pos[2] + sp8C[2];
|
||||
process_collision(player, &player->tyres[FRONT_RIGHT], sp80[0], sp80[1], sp80[2]);
|
||||
player_terrain_collision(player, &player->tyres[FRONT_RIGHT], sp80[0], sp80[1], sp80[2]);
|
||||
sp8C[0] = var_f12 - 2.6;
|
||||
sp8C[1] = -player->boundingBoxSize;
|
||||
sp8C[2] = (-var_f12) + 4.0f;
|
||||
@@ -1051,8 +1050,7 @@ void func_80029B4C(Player *player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) {
|
||||
player->tyres[BACK_LEFT].pos[0] = player->pos[0] + sp8C[0];
|
||||
player->tyres[BACK_LEFT].pos[1] = player->pos[1] + sp8C[1];
|
||||
player->tyres[BACK_LEFT].pos[2] = player->pos[2] + sp8C[2];
|
||||
process_collision(player, &player->tyres[BACK_LEFT], sp80[0], sp80[1], sp80[2]);
|
||||
|
||||
player_terrain_collision(player, &player->tyres[BACK_LEFT], sp80[0], sp80[1], sp80[2]);
|
||||
sp8C[0] = (-var_f12) + 2.6;
|
||||
sp8C[1] = -player->boundingBoxSize;
|
||||
sp8C[2] = (-var_f12) + 4.0f;
|
||||
@@ -1063,8 +1061,7 @@ void func_80029B4C(Player *player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) {
|
||||
player->tyres[BACK_RIGHT].pos[0] = player->pos[0] + sp8C[0];
|
||||
player->tyres[BACK_RIGHT].pos[1] = player->pos[1] + sp8C[1];
|
||||
player->tyres[BACK_RIGHT].pos[2] = player->pos[2] + sp8C[2];
|
||||
process_collision(player, &player->tyres[BACK_RIGHT], sp80[0], sp80[1], sp80[2]);
|
||||
|
||||
player_terrain_collision(player, &player->tyres[BACK_RIGHT], sp80[0], sp80[1], sp80[2]);
|
||||
if (!(player->effects & 8)) {
|
||||
a = (player->tyres[BACK_LEFT].baseHeight + player->tyres[FRONT_LEFT].baseHeight) / 2;
|
||||
move_f32_towards(&player->unk_230, a, 0.5f);
|
||||
@@ -1089,7 +1086,7 @@ void func_80029B4C(Player *player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) {
|
||||
move_s16_towards(&player->slopeAccel, func_802B7C40(temp_f0_2 / temp_f2_3), 0.5f);
|
||||
}
|
||||
else {
|
||||
temp_f0_2 = player->copy_rotation_y - arg2;
|
||||
temp_f0_2 = player->oldPos[1] - arg2;
|
||||
temp_v0 = func_802B7C40(temp_f0_2 / temp_f2_3);
|
||||
if (temp_f0_2 >= 0.0f) {
|
||||
temp_v0 /= 4;
|
||||
@@ -1169,7 +1166,7 @@ void func_8002A194(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
||||
temp_f0 = (player->unk_1F8 - player->unk_1FC);
|
||||
move_s16_towards(&player->slopeAccel, func_802B7C40(temp_f0 / var_f20), 0.5f);
|
||||
} else {
|
||||
temp_f0 = player->copy_rotation_y - arg2;
|
||||
temp_f0 = player->oldPos[1] - arg2;
|
||||
temp_v0 = func_802B7C40(temp_f0 / var_f20);
|
||||
if (temp_f0 >= 0.0f) {
|
||||
var_a1 = temp_v0 * 2;
|
||||
@@ -1695,7 +1692,7 @@ void func_8002B9CC(Player *player, s8 arg1, UNUSED s32 arg2) {
|
||||
func_8008C73C(player, arg1);
|
||||
}
|
||||
}
|
||||
temp = (-(s16)get_angle_between_two_vectors(player->pos, &player->copy_rotation_x));
|
||||
temp = (-(s16)get_angle_between_two_vectors(player->pos, &player->oldPos[0]));
|
||||
temp2 = (player->rotation[1] - player->unk_0C0);
|
||||
temp = temp - temp2;
|
||||
player->unk_234 = temp / 182;
|
||||
@@ -1732,9 +1729,9 @@ void func_8002BB9C(Player *player, f32 *arg1, f32 *arg2, UNUSED s8 arg3, UNUSED
|
||||
|
||||
mtxf_translate_vec3f_mat3(sp58, sp64);
|
||||
|
||||
sp4C[0] = player->copy_rotation_x;
|
||||
sp4C[0] = player->oldPos[0];
|
||||
sp4C[1] = 0;
|
||||
sp4C[2] = player->copy_rotation_z;
|
||||
sp4C[2] = player->oldPos[2];
|
||||
|
||||
mtxf_translate_vec3f_mat3(sp4C, sp64);
|
||||
|
||||
@@ -2207,9 +2204,9 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
Vec3f sp160 = {0.0, 0.0, 0.0};
|
||||
f32 sp104[] = {0.825, 0.8, 0.725, 0.625, 0.425, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3};
|
||||
f32 temp;
|
||||
f32 spFC;
|
||||
f32 spF8;
|
||||
f32 spF4;
|
||||
f32 nextX;
|
||||
f32 nextY;
|
||||
f32 nextZ;
|
||||
f32 posX;
|
||||
f32 posY;
|
||||
f32 posZ;
|
||||
@@ -2273,7 +2270,7 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
spB0 = -1 * player->kartGravity;
|
||||
spAC = 0 * (player->unk_064[2] + sp16C[2]);
|
||||
}
|
||||
temp_f2_2 = ((player->copy_rotation_z - player->pos[2]) * coss(player->rotation[1] + player->unk_0C0)) + (-(player->copy_rotation_x - player->pos[0]) * sins(player->rotation[1] + player->unk_0C0));
|
||||
temp_f2_2 = ((player->oldPos[2] - player->pos[2]) * coss(player->rotation[1] + player->unk_0C0)) + (-(player->oldPos[0] - player->pos[0]) * sins(player->rotation[1] + player->unk_0C0));
|
||||
if (temp_f2_2 > 0.1) {
|
||||
player->unk_044 |= 8;
|
||||
} else {
|
||||
@@ -2325,22 +2322,22 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
posY = player->pos[1];
|
||||
posZ = player->pos[2];
|
||||
|
||||
player->copy_rotation_x = player->pos[0];
|
||||
player->copy_rotation_z = player->pos[2];
|
||||
player->copy_rotation_y = player->pos[1];
|
||||
spFC = posX + player->velocity[0] + D_8018CE10[playerId].unk_04[0];
|
||||
spF8 = posY + player->velocity[1];
|
||||
spF4 = posZ + player->velocity[2] + D_8018CE10[playerId].unk_04[2];
|
||||
player->oldPos[0] = player->pos[0];
|
||||
player->oldPos[2] = player->pos[2];
|
||||
player->oldPos[1] = player->pos[1];
|
||||
nextX = posX + player->velocity[0] + D_8018CE10[playerId].unk_04[0];
|
||||
nextY = posY + player->velocity[1];
|
||||
nextZ = posZ + player->velocity[2] + D_8018CE10[playerId].unk_04[2];
|
||||
|
||||
if (((((player->unk_0CA & 2) != 2)
|
||||
&& ((player->unk_0CA & 8) != 8))
|
||||
&& ((player->effects & HIT_EFFECT) != HIT_EFFECT))
|
||||
&& (!(player->unk_0CA & 1))) {
|
||||
func_8002AAC0(player);
|
||||
spF8 += player->kartHopVelocity;
|
||||
spF8 -= 0.02;
|
||||
nextY += player->kartHopVelocity;
|
||||
nextY -= 0.02;
|
||||
}
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spFC, spF8, spF4, player->copy_rotation_x, player->copy_rotation_y, player->copy_rotation_z);
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, nextX, nextY, nextZ, player->oldPos[0], player->oldPos[1], player->oldPos[2]);
|
||||
player->unk_058 = 0.0f;
|
||||
player->unk_060 = 0.0f;
|
||||
player->unk_05C = 1.0f;
|
||||
@@ -2404,16 +2401,16 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
}
|
||||
temp_var = player->collision.surfaceDistance[2];
|
||||
if (temp_var <= 0.0f) {
|
||||
func_8003F46C(player, sp8C, sp98, sp178, &temp_var, &spFC, &spF8, &spF4);
|
||||
func_8003F46C(player, sp8C, sp98, sp178, &temp_var, &nextX, &nextY, &nextZ);
|
||||
}
|
||||
temp_var = player->collision.surfaceDistance[0];
|
||||
if (temp_var < 0.0f) {
|
||||
func_8003F734(player, sp8C, sp98, &temp_var, &spFC, &spF8, &spF4);
|
||||
func_8003F734(player, sp8C, sp98, &temp_var, &nextX, &nextY, &nextZ);
|
||||
func_8002C954(player, playerId, sp98);
|
||||
}
|
||||
temp_var = player->collision.surfaceDistance[1];
|
||||
if (temp_var < 0.0f) {
|
||||
func_8003FBAC(player, sp8C, sp98, &temp_var, &spFC, &spF8, &spF4);
|
||||
func_8003FBAC(player, sp8C, sp98, &temp_var, &nextX, &nextY, &nextZ);
|
||||
func_8002C954(player, playerId, sp98);
|
||||
}
|
||||
temp_var = player->collision.surfaceDistance[0];
|
||||
@@ -2437,13 +2434,13 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
} else if (((!(player->effects & 8)) && (func_802ABDB8(player->collision.meshIndexZX) == 0)) && (player->effects & 0x10000)) {
|
||||
func_8008F5A4(player, playerId);
|
||||
}
|
||||
player->unk_074 = calculate_surface_height(spFC, spF8, spF4, player->collision.meshIndexZX);
|
||||
player->unk_074 = calculate_surface_height(nextX, nextY, nextZ, player->collision.meshIndexZX);
|
||||
if (((player->type & PLAYER_HUMAN) == PLAYER_HUMAN) && (((gActiveScreenMode == SCREEN_MODE_1P) || (gActiveScreenMode == SCREEN_MODE_2P_SPLITSCREEN_VERTICAL)) || (gActiveScreenMode == SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL))) {
|
||||
func_80029B4C(player, spFC, spF8, spF4);
|
||||
func_80029B4C(player, nextX, nextY, nextZ);
|
||||
} else {
|
||||
func_8002A194(player, spFC, spF8, spF4);
|
||||
func_8002A194(player, nextX, nextY, nextZ);
|
||||
}
|
||||
func_8002AE38(player, playerId, posX, posZ, spFC, spF4);
|
||||
func_8002AE38(player, playerId, posX, posZ, nextX, nextZ);
|
||||
|
||||
temp2 = (sp98[0] * sp98[0]) + (sp98[2] * sp98[2]);
|
||||
player->unk_22C = player->unk_094;
|
||||
@@ -2456,12 +2453,12 @@ void func_8002D268(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
sp98[0] = sp98[0] + (-1 * sp98[0]);
|
||||
sp98[2] = sp98[2] + (-1 * sp98[2]);
|
||||
} else {
|
||||
player->pos[0] = spFC;
|
||||
player->pos[2] = spF4;
|
||||
player->pos[0] = nextX;
|
||||
player->pos[2] = nextZ;
|
||||
}
|
||||
player->pos[1] = spF8;
|
||||
player->pos[1] = nextY;
|
||||
if ((player->type & PLAYER_HUMAN) && (!(player->type & PLAYER_KART_AI))) {
|
||||
func_8002BB9C(player, &spFC, &spF4, screenId, playerId, sp98);
|
||||
func_8002BB9C(player, &nextX, &nextZ, screenId, playerId, sp98);
|
||||
}
|
||||
player->unk_064[0] = sp178[0];
|
||||
player->unk_064[2] = sp178[2];
|
||||
@@ -2504,7 +2501,7 @@ void func_8002E4C4(Player *player) {
|
||||
player->kartHopVelocity = 0.0f;
|
||||
player->pos[1] = spawn_actor_on_surface(player->pos[0], D_80164510[player_index] + 10.0f, player->pos[2]) + player->boundingBoxSize;
|
||||
if (((player->pos[1] - D_80164510[player_index]) > 1200.0f) || ((player->pos[1] - D_80164510[player_index]) < -1200.0f)) {
|
||||
player->pos[1] = player->copy_rotation_y;
|
||||
player->pos[1] = player->oldPos[1];
|
||||
}
|
||||
player->velocity[1] = 0.0f;
|
||||
}
|
||||
@@ -2596,16 +2593,16 @@ void func_8002E594(Player *player, UNUSED Camera *camera, s8 screenId, s8 player
|
||||
posY = player->pos[1];
|
||||
posZ = player->pos[2];
|
||||
|
||||
player->copy_rotation_x = player->pos[0];
|
||||
player->copy_rotation_y = player->pos[1];
|
||||
player->copy_rotation_z = player->pos[2];
|
||||
player->oldPos[0] = player->pos[0];
|
||||
player->oldPos[1] = player->pos[1];
|
||||
player->oldPos[2] = player->pos[2];
|
||||
|
||||
spD0 = posX + player->velocity[0] + D_8018CE10[playerId].unk_04[0];
|
||||
spCC = posY + player->velocity[1];
|
||||
spC8 = posZ + player->velocity[2] + D_8018CE10[playerId].unk_04[2];
|
||||
func_8002AAC0(player);
|
||||
spCC += player->kartHopVelocity;
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spD0, spCC, spC8, player->copy_rotation_x, player->copy_rotation_y, player->copy_rotation_z);
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spD0, spCC, spC8, player->oldPos[0], player->oldPos[1], player->oldPos[2]);
|
||||
player->effects |= 8;
|
||||
player->unk_0C2 += 1;
|
||||
player->unk_058 = 0.0f;
|
||||
@@ -2789,9 +2786,9 @@ void control_kart_ai_movement(Player *player, UNUSED Camera *camera, s8 arg2, s8
|
||||
sp68[2] = player->velocity[2];
|
||||
sp68[0] += (((spF4[0] + sp84) + spD0[0]) - (sp68[0] * (0.12 * player->kartFriction))) / 6000.0;
|
||||
sp68[2] += (((spF4[2] + sp7C) + spD0[2]) - (sp68[2] * (0.12 * player->kartFriction))) / 6000.0;
|
||||
player->copy_rotation_x = player->pos[0];
|
||||
player->copy_rotation_y = test;
|
||||
player->copy_rotation_z = player->pos[2];
|
||||
player->oldPos[0] = player->pos[0];
|
||||
player->oldPos[1] = test;
|
||||
player->oldPos[2] = player->pos[2];
|
||||
spCC = player->pos[0] + player->velocity[0];
|
||||
spC4 = player->pos[2] + player->velocity[2];
|
||||
player->unk_0C0 = 0;
|
||||
@@ -2870,9 +2867,9 @@ void func_8002F730(Player *player, UNUSED Camera *camera, UNUSED s8 screenId, s8
|
||||
spB8 = player->pos[2];
|
||||
|
||||
|
||||
player->copy_rotation_x = player->pos[0];
|
||||
player->copy_rotation_y = player->pos[1];
|
||||
player->copy_rotation_z = player->pos[2];
|
||||
player->oldPos[0] = player->pos[0];
|
||||
player->oldPos[1] = player->pos[1];
|
||||
player->oldPos[2] = player->pos[2];
|
||||
|
||||
spCC = player->velocity[0] + spC0;
|
||||
spC8 = player->velocity[1] + sp44;
|
||||
@@ -2881,7 +2878,7 @@ void func_8002F730(Player *player, UNUSED Camera *camera, UNUSED s8 screenId, s8
|
||||
func_8002AAC0(player);
|
||||
|
||||
spC8 += player->kartHopVelocity;
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spCC, spC8, spC4, player->copy_rotation_x, player->copy_rotation_y, player->copy_rotation_z);
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spCC, spC8, spC4, player->oldPos[0], player->oldPos[1], player->oldPos[2]);
|
||||
player->unk_058 = 0.0f;
|
||||
player->unk_05C = 1.0f;
|
||||
player->unk_060 = 0.0f;
|
||||
@@ -5002,9 +4999,9 @@ void func_80038C6C(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId)
|
||||
posY = player->pos[1];
|
||||
posZ = player->pos[2];
|
||||
|
||||
player->copy_rotation_x = player->pos[0];
|
||||
player->copy_rotation_y = player->pos[1];
|
||||
player->copy_rotation_z = player->pos[2];
|
||||
player->oldPos[0] = player->pos[0];
|
||||
player->oldPos[1] = player->pos[1];
|
||||
player->oldPos[2] = player->pos[2];
|
||||
|
||||
spEC = posX + player->velocity[0];
|
||||
spE8 = posY + player->velocity[1];
|
||||
@@ -5012,7 +5009,7 @@ void func_80038C6C(Player *player, UNUSED Camera *camera, s8 arg2, s8 playerId)
|
||||
func_8002AAC0(player);
|
||||
spE8 += player->kartHopVelocity;
|
||||
spE8 -= 0.02;
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spEC, spE8, spE4, player->copy_rotation_x, player->copy_rotation_y, player->copy_rotation_z);
|
||||
actor_terrain_collision(&player->collision, player->boundingBoxSize, spEC, spE8, spE4, player->oldPos[0], player->oldPos[1], player->oldPos[2]);
|
||||
player->unk_058 = 0;
|
||||
player->unk_060 = 0;
|
||||
player->unk_05C = 1.0f;
|
||||
|
||||
+3
-3
@@ -1155,8 +1155,8 @@ void spawn_course_actors(void) {
|
||||
|
||||
/**
|
||||
* @brief Loads actor textures, course specific actor textures.
|
||||
* Calls to init_course_vehicles and place_course_actors
|
||||
*
|
||||
* Calls to spawn_course_vehicles and place_course_actors
|
||||
*
|
||||
*/
|
||||
void init_actors_and_load_textures(void) {
|
||||
set_segment_base_addr(3, (void *) gNextFreeMemoryAddress);
|
||||
@@ -1256,7 +1256,7 @@ void init_actors_and_load_textures(void) {
|
||||
init_red_shell_texture();
|
||||
destroy_all_actors();
|
||||
spawn_course_actors();
|
||||
init_course_vehicles();
|
||||
spawn_course_vehicles();
|
||||
}
|
||||
|
||||
void play_sound_before_despawn(struct Actor *actor) {
|
||||
|
||||
+96
-94
@@ -82,7 +82,7 @@ f32 func_802AAB4C(Player *player) {
|
||||
}
|
||||
return D_8015F8E4;
|
||||
case COURSE_DK_JUNGLE:
|
||||
temp_v1 = get_section_id(player->collision.meshIndexZX) & 0xFF;
|
||||
temp_v1 = get_track_section_id(player->collision.meshIndexZX) & 0xFF;
|
||||
if (temp_v1 == 0xFF) {
|
||||
if ((get_surface_type(player->collision.meshIndexZX) & 0xFF) == CAVE) {
|
||||
return -475.0f;
|
||||
@@ -496,7 +496,7 @@ s8 get_surface_type(u16 index) {
|
||||
return triangle->surfaceType;
|
||||
}
|
||||
|
||||
s16 get_section_id(u16 index) {
|
||||
s16 get_track_section_id(u16 index) {
|
||||
CollisionTriangle *triangle = &gCollisionMesh[index];
|
||||
return triangle->flags & 0xFF;
|
||||
}
|
||||
@@ -748,7 +748,7 @@ UNUSED s32 detect_tyre_collision(KartTyre *tyre) {
|
||||
// depending on which (if any) if statements were entered on the loop's last cycle
|
||||
}
|
||||
|
||||
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_drivable_surface(Collision *collision, f32 boundingBoxSize, f32 newX, f32 newY, f32 newZ, u16 index, f32 oldX, f32 oldY, f32 oldZ) {
|
||||
CollisionTriangle *triangle = &gCollisionMesh[index];
|
||||
UNUSED s32 pad;
|
||||
f32 x4;
|
||||
@@ -768,19 +768,19 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
|
||||
f32 area3;
|
||||
s32 b = 1;
|
||||
|
||||
if (triangle->minX > x1) {
|
||||
if (triangle->minX > newX) {
|
||||
return 0;
|
||||
}
|
||||
if (triangle->minZ > z1) {
|
||||
if (triangle->minZ > newZ) {
|
||||
return 0;
|
||||
}
|
||||
if (triangle->maxX < x1) {
|
||||
if (triangle->maxX < newX) {
|
||||
return 0;
|
||||
}
|
||||
if (triangle->maxZ < z1) {
|
||||
if (triangle->maxZ < newZ) {
|
||||
return 0;
|
||||
}
|
||||
if ((triangle->minY - boundingBoxSize * 3.0f) > y1) {
|
||||
if ((triangle->minY - boundingBoxSize * 3.0f) > newY) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -793,22 +793,22 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
|
||||
x4 = (f32) triangle->vtx3->v.ob[0];
|
||||
z4 = (f32) triangle->vtx3->v.ob[2];
|
||||
|
||||
area = (z2 - z1) * (x3 - x1) - (x2 - x1) * (z3 - z1);
|
||||
area = (z2 - newZ) * (x3 - newX) - (x2 - newX) * (z3 - newZ);
|
||||
|
||||
if (area == 0) {
|
||||
area2 = (z3 - z1) * (x4 - x1) - (x3 - x1) * (z4 - z1);
|
||||
area3 = (z4 - z1) * (x2 - x1) - (x4 - x1) * (z2 - z1);
|
||||
area2 = (z3 - newZ) * (x4 - newX) - (x3 - newX) * (z4 - newZ);
|
||||
area3 = (z4 - newZ) * (x2 - newX) - (x4 - newX) * (z2 - newZ);
|
||||
if (area2 * area3 < 0.0f) {
|
||||
b = 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
area2 = (z3 - z1) * (x4 - x1) - (x3 - x1) * (z4 - z1);
|
||||
area2 = (z3 - newZ) * (x4 - newX) - (x3 - newX) * (z4 - newZ);
|
||||
|
||||
|
||||
if (area2 == 0) {
|
||||
|
||||
area3 = (z4 - z1) * (x2 - x1) - (x4 - x1) * (z2 - z1);
|
||||
area3 = (z4 - newZ) * (x2 - newX) - (x4 - newX) * (z2 - newZ);
|
||||
|
||||
if (area * area3 < 0.0f) {
|
||||
b = 0;
|
||||
@@ -817,7 +817,7 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
|
||||
if ((area * area2) < 0.0f) {
|
||||
b = 0;
|
||||
} else {
|
||||
area3 = (z4- z1) * (x2 - x1) - (x4 - x1) * (z2 - z1);
|
||||
area3 = (z4- newZ) * (x2 - newX) - (x4 - newX) * (z2 - newZ);
|
||||
if (area3 != 0) {
|
||||
if (area2 * area3 < 0.0f) {
|
||||
b = 0;
|
||||
@@ -830,7 +830,7 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
|
||||
return 0;
|
||||
}
|
||||
|
||||
surfaceDistance = (triangle->normalX * x1) + (triangle->normalY * y1) + (triangle->normalZ * z1) + triangle->distance;
|
||||
surfaceDistance = (triangle->normalX * newX) + (triangle->normalY * newY) + (triangle->normalZ * newZ) + triangle->distance;
|
||||
|
||||
if (surfaceDistance > boundingBoxSize) {
|
||||
if (collision->surfaceDistance[2] > surfaceDistance) {
|
||||
@@ -844,25 +844,26 @@ s32 is_colliding_with_drivable_surface(Collision *collision, f32 boundingBoxSize
|
||||
return 0;
|
||||
}
|
||||
|
||||
temp = (triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ) + triangle->distance;
|
||||
temp = (triangle->normalX * oldX) + (triangle->normalY * oldY) + (triangle->normalZ * oldZ) + triangle->distance;
|
||||
|
||||
if (temp < 0.0f) {
|
||||
return 0;
|
||||
}
|
||||
collision->unk34 = 1;
|
||||
collision->meshIndexZX = index;
|
||||
collision->surfaceDistance[2] = surfaceDistance - boundingBoxSize;
|
||||
collision->orientationVector[0] = triangle->normalX;
|
||||
collision->orientationVector[1] = triangle->normalY;
|
||||
collision->orientationVector[2] = triangle->normalZ;
|
||||
return 1;
|
||||
|
||||
collision->unk34 = 1;
|
||||
collision->meshIndexZX = index;
|
||||
collision->surfaceDistance[2] = surfaceDistance - boundingBoxSize;
|
||||
collision->orientationVector[0] = triangle->normalX;
|
||||
collision->orientationVector[1] = triangle->normalY;
|
||||
collision->orientationVector[2] = triangle->normalZ;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wall collision
|
||||
*/
|
||||
s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 arg5, f32 arg6, f32 arg7, f32 arg8) {
|
||||
CollisionTriangle *triangle = &gCollisionMesh[arg5];
|
||||
s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, f32 posY, f32 posZ) {
|
||||
CollisionTriangle *triangle = &gCollisionMesh[surfaceIndex];
|
||||
UNUSED s32 pad[6];
|
||||
f32 x4;
|
||||
f32 y4;
|
||||
@@ -879,22 +880,22 @@ s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
|
||||
f32 area3;
|
||||
s32 b = true;
|
||||
if (triangle->minX > x1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (triangle->maxX < x1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (triangle->maxY < y1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (triangle->minY > y1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if ((triangle->minZ - boundingBoxSize * 3.0f) > z1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if ((triangle->maxZ + boundingBoxSize * 3.0f) < z1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
x2 = (f32) triangle->vtx1->v.ob[0];
|
||||
@@ -941,107 +942,108 @@ s32 is_colliding_with_wall2(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!b) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
distanceToSurface = ((triangle->normalX * x1) + (triangle->normalY * y1) + (triangle->normalZ * z1)) + triangle->distance;
|
||||
if (triangle->flags & 0x200) {
|
||||
distanceToSurface2 = ((triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8)) + triangle->distance;
|
||||
distanceToSurface2 = ((triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ)) + triangle->distance;
|
||||
if ((distanceToSurface > 0.0f) && (distanceToSurface2 > 0.0f)) {
|
||||
if (distanceToSurface < boundingBoxSize) {
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk48[0] = triangle->normalX;
|
||||
arg->unk48[1] = triangle->normalY;
|
||||
arg->unk48[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
if ((distanceToSurface < 0.0f) && (distanceToSurface2 < 0.0f)) {
|
||||
distanceToSurface *= -1.0f;
|
||||
if (distanceToSurface < boundingBoxSize) {
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk48[0] = -triangle->normalX;
|
||||
arg->unk48[1] = -triangle->normalY;
|
||||
arg->unk48[2] = -triangle->normalZ;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if ((distanceToSurface > 0.0f) && (distanceToSurface2 < 0.0f)) {
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = -(distanceToSurface + boundingBoxSize);
|
||||
arg->unk48[0] = -triangle->normalX;
|
||||
arg->unk48[1] = -triangle->normalY;
|
||||
arg->unk48[2] = -triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
if ((distanceToSurface < 0.0f) && (distanceToSurface2 > 0.0f)) {
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = distanceToSurface + boundingBoxSize;
|
||||
arg->unk48[0] = triangle->normalX;
|
||||
arg->unk48[1] = triangle->normalY;
|
||||
arg->unk48[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
if (distanceToSurface == 0.0f) {
|
||||
if (distanceToSurface2 >= 0.0f) {
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = distanceToSurface2 + boundingBoxSize;
|
||||
arg->unk48[0] = triangle->normalX;
|
||||
arg->unk48[1] = triangle->normalY;
|
||||
arg->unk48[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = -(distanceToSurface2 + boundingBoxSize);
|
||||
arg->unk48[0] = triangle->normalX;
|
||||
arg->unk48[1] = triangle->normalY;
|
||||
arg->unk48[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (distanceToSurface > boundingBoxSize) {
|
||||
if (distanceToSurface < arg->surfaceDistance[0]) {
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk48[0] = triangle->normalX;
|
||||
arg->unk48[1] = triangle->normalY;
|
||||
arg->unk48[2] = triangle->normalZ;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
distanceToSurface2 = (triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8) + triangle->distance;
|
||||
distanceToSurface2 = (triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ) + triangle->distance;
|
||||
if (distanceToSurface2 < 0.0f) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
arg->unk30 = 1;
|
||||
arg->meshIndexYX = arg5;
|
||||
arg->meshIndexYX = surfaceIndex;
|
||||
arg->surfaceDistance[0] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk48[0] = triangle->normalX;
|
||||
arg->unk48[1] = triangle->normalY;
|
||||
arg->unk48[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is actually more like colliding with face X/Y/Z
|
||||
*/
|
||||
s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 arg5, f32 arg6, f32 arg7, f32 arg8) {
|
||||
CollisionTriangle *triangle = &gCollisionMesh[arg5];
|
||||
s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, u16 surfaceIndex, f32 posX, f32 posY, f32 posZ) {
|
||||
CollisionTriangle *triangle = &gCollisionMesh[surfaceIndex];
|
||||
s32 b = 1;
|
||||
UNUSED s32 pad[7];
|
||||
f32 y4;
|
||||
@@ -1059,22 +1061,22 @@ s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
|
||||
f32 area3;
|
||||
|
||||
if (triangle->minZ > z1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (triangle->maxZ < z1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (triangle->maxY < y1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (triangle->minY > y1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if ((triangle->minX - boundingBoxSize * 3.0f) > x1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if ((triangle->maxX + boundingBoxSize * 3.0f) < x1) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
z2 = (f32) triangle->vtx1->v.ob[2];
|
||||
@@ -1122,103 +1124,103 @@ s32 is_colliding_with_wall1(Collision *arg, f32 boundingBoxSize, f32 x1, f32 y1,
|
||||
}
|
||||
}
|
||||
if (b == 0) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
distanceToSurface = ((triangle->normalX * x1) + (triangle->normalY * y1) + (triangle->normalZ * z1)) + triangle->distance;
|
||||
if (triangle->flags & 0x200) {
|
||||
distanceToSurface2 = ((triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8)) + triangle->distance;
|
||||
distanceToSurface2 = ((triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ)) + triangle->distance;
|
||||
//sp48 = temp_f4_2;
|
||||
if ((distanceToSurface > 0.0f) && (distanceToSurface2 > 0.0f)) {
|
||||
if (distanceToSurface < boundingBoxSize) {
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk54[0] = triangle->normalX;
|
||||
arg->unk54[1] = triangle->normalY;
|
||||
arg->unk54[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
if ((distanceToSurface < 0.0f) && (distanceToSurface2 < 0.0f)) {
|
||||
distanceToSurface *= -1.0f;
|
||||
if (distanceToSurface < boundingBoxSize) {
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk54[0] = -triangle->normalX;
|
||||
arg->unk54[1] = -triangle->normalY;
|
||||
arg->unk54[2] = -triangle->normalZ;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if ((distanceToSurface > 0.0f) && (distanceToSurface2 < 0.0f)) {
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = -(distanceToSurface + boundingBoxSize);
|
||||
arg->unk54[0] = -triangle->normalX;
|
||||
arg->unk54[1] = -triangle->normalY;
|
||||
arg->unk54[2] = -triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
if ((distanceToSurface < 0.0f) && (distanceToSurface2 > 0.0f)) {
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = distanceToSurface + boundingBoxSize;
|
||||
arg->unk54[0] = triangle->normalX;
|
||||
arg->unk54[1] = triangle->normalY;
|
||||
arg->unk54[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
if (distanceToSurface == 0.0f) {
|
||||
if (distanceToSurface2 >= 0.0f) {
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = distanceToSurface2 + boundingBoxSize;
|
||||
arg->unk54[0] = triangle->normalX;
|
||||
arg->unk54[1] = triangle->normalY;
|
||||
arg->unk54[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = -(distanceToSurface2 + boundingBoxSize);
|
||||
arg->unk54[0] = triangle->normalX;
|
||||
arg->unk54[1] = triangle->normalY;
|
||||
arg->unk54[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
if (distanceToSurface > boundingBoxSize) {
|
||||
if (arg->surfaceDistance[1] > distanceToSurface) {
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk54[0] = triangle->normalX;
|
||||
arg->unk54[1] = triangle->normalY;
|
||||
arg->unk54[2] = triangle->normalZ;
|
||||
}
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
|
||||
distanceToSurface2 = (triangle->normalX * arg6) + (triangle->normalY * arg7) + (triangle->normalZ * arg8) + triangle->distance;
|
||||
distanceToSurface2 = (triangle->normalX * posX) + (triangle->normalY * posY) + (triangle->normalZ * posZ) + triangle->distance;
|
||||
if (distanceToSurface2 < 0.0f) {
|
||||
return 0;
|
||||
return NO_COLLISION;
|
||||
}
|
||||
arg->unk32 = 1;
|
||||
arg->meshIndexZY = arg5;
|
||||
arg->meshIndexZY = surfaceIndex;
|
||||
arg->surfaceDistance[1] = distanceToSurface - boundingBoxSize;
|
||||
arg->unk54[0] = triangle->normalX;
|
||||
arg->unk54[1] = triangle->normalY;
|
||||
arg->unk54[2] = triangle->normalZ;
|
||||
return 1;
|
||||
return COLLISION;
|
||||
}
|
||||
|
||||
u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2) {
|
||||
u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 newX, f32 newY, f32 newZ, f32 oldX, f32 oldY, f32 oldZ) {
|
||||
s32 courseLengthX;
|
||||
s32 courseLengthZ;
|
||||
s16 sectionIndexX;
|
||||
@@ -1244,19 +1246,19 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
|
||||
|
||||
// Check if an intersection test has already been performed.
|
||||
if ((s32) collision->meshIndexZX < (s32) gCollisionMeshCount) {
|
||||
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, x1, y1, z1, collision->meshIndexZX, x2, y2, z2) == 1) {
|
||||
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexZX, oldX, oldY, oldZ) == COLLISION) {
|
||||
flags |= FACING_Y_AXIS;
|
||||
}
|
||||
}
|
||||
|
||||
if ((s32) collision->meshIndexYX < (s32) gCollisionMeshCount) {
|
||||
if (is_colliding_with_wall2(collision, boundingBoxSize, x1, y1, z1, collision->meshIndexYX, x2, y2, z2) == 1) {
|
||||
if (is_colliding_with_wall2(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexYX, oldX, oldY, oldZ) == COLLISION) {
|
||||
flags |= FACING_Z_AXIS;
|
||||
}
|
||||
}
|
||||
|
||||
if ((s32) collision->meshIndexZY < (s32) gCollisionMeshCount) {
|
||||
if (is_colliding_with_wall1(collision, boundingBoxSize, x1, y1, z1, collision->meshIndexZY, x2, y2, z2) == 1) {
|
||||
if (is_colliding_with_wall1(collision, boundingBoxSize, newX, newY, newZ, collision->meshIndexZY, oldX, oldY, oldZ) == COLLISION) {
|
||||
flags |= FACING_X_AXIS;
|
||||
}
|
||||
}
|
||||
@@ -1271,9 +1273,9 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
|
||||
sectionX = courseLengthX / GRID_SIZE;
|
||||
sectionZ = courseLengthZ / GRID_SIZE;
|
||||
|
||||
sectionIndexX = (x1 - gCourseMinX) / sectionX;
|
||||
sectionIndexZ = (z1 - gCourseMinZ) / sectionZ;
|
||||
|
||||
sectionIndexX = (newX - gCourseMinX) / sectionX;
|
||||
sectionIndexZ = (newZ - gCourseMinZ) / sectionZ;
|
||||
|
||||
if (sectionIndexX < 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1306,7 +1308,7 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
|
||||
if ((gCollisionMesh[collisionIndex].flags & FACING_Y_AXIS)) {
|
||||
if ((flags & FACING_Y_AXIS) == 0) {
|
||||
if (collisionIndex != collision->meshIndexZX) {
|
||||
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, x1, y1, z1, collisionIndex, x2, y2, z2) == 1) {
|
||||
if (is_colliding_with_drivable_surface(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, oldZ) == COLLISION) {
|
||||
flags |= FACING_Y_AXIS;
|
||||
}
|
||||
}
|
||||
@@ -1314,14 +1316,14 @@ u16 actor_terrain_collision(Collision *collision, f32 boundingBoxSize, f32 x1, f
|
||||
} else if ((gCollisionMesh[collisionIndex].flags & FACING_X_AXIS) != 0) {
|
||||
if ((flags & FACING_X_AXIS) == 0) {
|
||||
if (collisionIndex != collision->meshIndexZY) {
|
||||
if (is_colliding_with_wall1(collision, boundingBoxSize, x1, y1, z1, collisionIndex, x2, y2, z2) == 1) {
|
||||
if (is_colliding_with_wall1(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, oldZ) == COLLISION) {
|
||||
flags |= FACING_X_AXIS;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ((flags & FACING_Z_AXIS) == 0) {
|
||||
if (collisionIndex != collision->meshIndexYX) {
|
||||
if (is_colliding_with_wall2(collision, boundingBoxSize, x1, y1, z1, collisionIndex, x2, y2, z2) == 1) {
|
||||
if (is_colliding_with_wall2(collision, boundingBoxSize, newX, newY, newZ, collisionIndex, oldX, oldY, oldZ) == COLLISION) {
|
||||
flags |= FACING_Z_AXIS;
|
||||
}
|
||||
}
|
||||
@@ -2107,7 +2109,7 @@ void subtract_scaled_vector(Vec3f pos1, f32 boundingBoxSize, Vec3f pos2) {
|
||||
pos2[2] -= pos1[2] * boundingBoxSize;
|
||||
}
|
||||
|
||||
u16 process_collision(Player *player, KartTyre *tyre, f32 tyre2X, f32 tyre2Y, f32 tyre2Z) {
|
||||
u16 player_terrain_collision(Player *player, KartTyre *tyre, f32 tyre2X, f32 tyre2Y, f32 tyre2Z) {
|
||||
Collision wtf;
|
||||
Collision *collision = &wtf;
|
||||
UNUSED s32 pad;
|
||||
|
||||
@@ -13,7 +13,7 @@ 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_section_id(u16);
|
||||
s16 get_track_section_id(u16);
|
||||
s16 func_802ABD7C(u16);
|
||||
s16 func_802ABDB8(u16);
|
||||
s16 func_802ABDF4(u16);
|
||||
@@ -21,7 +21,7 @@ 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 process_collision(Player*, KartTyre*, f32, f32, 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);
|
||||
|
||||
@@ -501,7 +501,7 @@ void start_race(void) {
|
||||
|
||||
f32 func_8028EE8C(s32 arg0) {
|
||||
f32 temp_v0 = gPlayers[arg0].pos[2];
|
||||
f32 temp_v1 = gPlayers[arg0].copy_rotation_z;
|
||||
f32 temp_v1 = gPlayers[arg0].oldPos[2];
|
||||
f32 temp_f14 = D_8015F8D0[2] - temp_v0;
|
||||
f32 temp_f16 = temp_v1 - D_8015F8D0[2];
|
||||
return gCourseTimer - ((COURSE_TIMER_ITER_f * temp_f14) / (temp_f14 + temp_f16));
|
||||
|
||||
@@ -116,8 +116,8 @@ void render_course_segments(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
arg1->playerDirection = var_a3;
|
||||
|
||||
if (D_80152300[camera - camera1] == 1) {
|
||||
sp1E = get_section_id(camera->collision.meshIndexZX);
|
||||
temp_v0_3 = get_section_id(player->collision.meshIndexZX);
|
||||
sp1E = get_track_section_id(camera->collision.meshIndexZX);
|
||||
temp_v0_3 = get_track_section_id(player->collision.meshIndexZX);
|
||||
index = sp1E - temp_v0_3;
|
||||
if ((index < 2) && (index >= -1)) {
|
||||
if (sp1E == 255) {
|
||||
@@ -170,7 +170,7 @@ void render_course_segments(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
index = get_section_id(camera->collision.meshIndexZX);
|
||||
index = get_track_section_id(camera->collision.meshIndexZX);
|
||||
if (camera->collision.surfaceDistance[2] > 30.0f) {
|
||||
index = arg1->pathCounter;
|
||||
} else if (index == 255) {
|
||||
|
||||
@@ -3575,8 +3575,8 @@ void render_object_train_smoke_particle(s32 objectIndex, s32 cameraId) {
|
||||
}
|
||||
}
|
||||
|
||||
// Train smoke?
|
||||
void render_object_train_smoke_particles(s32 cameraId) {
|
||||
// Trains smoke particles.
|
||||
void render_object_trains_smoke_particles(s32 cameraId) {
|
||||
UNUSED s32 pad;
|
||||
UNUSED s32 j;
|
||||
Camera *camera;
|
||||
|
||||
@@ -349,7 +349,7 @@ void func_80053D74(s32, s32, s32);
|
||||
void func_80053E6C(s32);
|
||||
|
||||
void render_object_train_smoke_particle(s32, s32);
|
||||
void render_object_train_smoke_particles(s32);
|
||||
void render_object_trains_smoke_particles(s32);
|
||||
void render_object_paddle_boat_smoke_particle(s32, s32);
|
||||
void render_object_paddle_boat_smoke_particles(s32);
|
||||
void render_object_bowser_flame_particle(s32, s32);
|
||||
|
||||
+3
-3
@@ -113,14 +113,14 @@ void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingC
|
||||
ret = spawn_actor_on_surface(startingRow, arg4 + 50.0f, startingColumn) + player->boundingBoxSize;
|
||||
player->pos[2] = startingColumn;
|
||||
player->pos[1] = ret;
|
||||
player->copy_rotation_x = startingRow;
|
||||
player->copy_rotation_y = ret;
|
||||
player->oldPos[0] = startingRow;
|
||||
player->oldPos[1] = ret;
|
||||
|
||||
D_80164510[playerIndex] = ret;
|
||||
|
||||
|
||||
player->rotation[0] = 0;
|
||||
player->copy_rotation_z = startingColumn;
|
||||
player->oldPos[2] = startingColumn;
|
||||
player->unk_05C = 1.0f;
|
||||
player->unk_058 = 0.0f;
|
||||
player->unk_060 = 0.0f;
|
||||
|
||||
+18
-18
@@ -1515,31 +1515,31 @@ void func_8007542C(s32 arg0) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_80075574(s32 objectIndex, Vec3f arg1, f32 arg2) {
|
||||
void init_train_smoke(s32 objectIndex, Vec3f pos, f32 velocity) {
|
||||
Object *object;
|
||||
UNUSED s32 pad[2];
|
||||
|
||||
init_object(objectIndex, 0);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->origin_pos[0] = arg1[0];
|
||||
object->origin_pos[1] = arg1[1];
|
||||
object->origin_pos[2] = arg1[2];
|
||||
object->velocity[1] = arg2;
|
||||
object->origin_pos[0] = pos[0];
|
||||
object->origin_pos[1] = pos[1];
|
||||
object->origin_pos[2] = pos[2];
|
||||
object->velocity[1] = velocity;
|
||||
object->type = random_int(0x0064U) + 0x1E;
|
||||
}
|
||||
|
||||
s32 func_800755FC(s32 arg0, Vec3f arg1, f32 arg2) {
|
||||
s32 spawn_train_smoke(s32 trainIndex, Vec3f pos, f32 velocity) {
|
||||
s32 objectIndex;
|
||||
|
||||
if (arg0 == 0) {
|
||||
if (trainIndex == 0) {
|
||||
objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
|
||||
if (objectIndex != NULL_OBJECT_ID) {
|
||||
func_80075574(objectIndex, arg1, arg2);
|
||||
init_train_smoke(objectIndex, pos, velocity);
|
||||
}
|
||||
} else {
|
||||
objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE);
|
||||
if (objectIndex != NULL_OBJECT_ID) {
|
||||
func_80075574(objectIndex, arg1, arg2);
|
||||
init_train_smoke(objectIndex, pos, velocity);
|
||||
}
|
||||
}
|
||||
return objectIndex;
|
||||
@@ -1635,31 +1635,31 @@ void update_train_smoke(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void func_800759EC(s32 objectIndex, Vec3f arg1, f32 arg2) {
|
||||
void init_ferry_smoke(s32 objectIndex, Vec3f pos, f32 velocity) {
|
||||
Object *object;
|
||||
|
||||
init_object(objectIndex, 0);
|
||||
object = &gObjectList[objectIndex];
|
||||
object->origin_pos[0] = arg1[0];
|
||||
object->origin_pos[1] = arg1[1];
|
||||
object->origin_pos[2] = arg1[2];
|
||||
object->velocity[1] = arg2;
|
||||
object->origin_pos[0] = pos[0];
|
||||
object->origin_pos[1] = pos[1];
|
||||
object->origin_pos[2] = pos[2];
|
||||
object->velocity[1] = velocity;
|
||||
object->type = 0x00FF;
|
||||
object->unk_0A2 = 0x0096;
|
||||
}
|
||||
|
||||
s32 func_80075A6C(s32 arg0, Vec3f arg1, f32 arg2) {
|
||||
s32 spawn_ferry_smoke(s32 ferryIndex, Vec3f pos, f32 velocity) {
|
||||
s32 objectIndex;
|
||||
|
||||
if (arg0 == 0) {
|
||||
if (ferryIndex == 0) {
|
||||
objectIndex = add_unused_obj_index(gObjectParticle2, &gNextFreeObjectParticle2, gObjectParticle2_SIZE);
|
||||
if (objectIndex != NULL_OBJECT_ID) {
|
||||
func_800759EC(objectIndex, arg1, arg2);
|
||||
init_ferry_smoke(objectIndex, pos, velocity);
|
||||
}
|
||||
} else {
|
||||
objectIndex = add_unused_obj_index(gObjectParticle3, &gNextFreeObjectParticle3, gObjectParticle3_SIZE);
|
||||
if (objectIndex != NULL_OBJECT_ID) {
|
||||
func_800759EC(objectIndex, arg1, arg2);
|
||||
init_ferry_smoke(objectIndex, pos, velocity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,14 +120,14 @@ void func_80074FD8(s32);
|
||||
void func_800750D8(s32, s32, Vec3f, s32, s32);
|
||||
void func_80075304(Vec3f, s32, s32, s32);
|
||||
void func_8007542C(s32);
|
||||
void func_80075574(s32, Vec3f, f32);
|
||||
s32 func_800755FC(s32, Vec3f, f32);
|
||||
void init_train_smoke(s32, Vec3f, f32);
|
||||
s32 spawn_train_smoke(s32, Vec3f, f32);
|
||||
void func_80075698(s32);
|
||||
void func_80075714(s32);
|
||||
void update_train_smoke(void);
|
||||
void func_80075838(void);
|
||||
void func_800759EC(s32, Vec3f, f32);
|
||||
s32 func_80075A6C(s32, Vec3f, f32);
|
||||
void init_ferry_smoke(s32, Vec3f, f32);
|
||||
s32 spawn_ferry_smoke(s32, Vec3f, f32);
|
||||
void func_80075B08(s32);
|
||||
void func_80075B84(s32);
|
||||
void update_ferries_smoke_particle(void);
|
||||
|
||||
Reference in New Issue
Block a user