This commit is contained in:
Sonic Dreamcaster 2025-05-17 20:33:28 -03:00
parent d52831e4ba
commit 3b2efbb81a
13 changed files with 470 additions and 466 deletions

View File

@ -20,12 +20,16 @@ typedef struct {
/* 0x8 */ f32 z;
} Vec3f; // size = 0xC
typedef f32 Vec3fa[3];
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
/* 0x4 */ s16 z;
} Vec3s; // size = 0x6;
typedef s16 Vec3sa[3];
typedef s32 Vec3iu[3];
typedef u16 Vec3su[3];

View File

@ -72,7 +72,7 @@ void update_actor_banana(struct BananaActor* banana) {
temp_f0 = (player->unk_094 * 0.75f) + 3.5f + pad3;
}
vec3f_set(someVelocity, 0, pad3, temp_f0);
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation.y + player->unk_0C0);
banana->velocity.x = someVelocity[0];
banana->velocity.y = someVelocity[1];
banana->velocity.z = someVelocity[2];
@ -121,7 +121,7 @@ void update_actor_banana(struct BananaActor* banana) {
someVelocity[0] = 0.0f;
someVelocity[1] = 0.0f;
someVelocity[2] = -5.0f;
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation.y + player->unk_0C0);
unkX = player->pos.x + someVelocity[0];
unkY = player->pos.y + someVelocity[1];
unkZ = player->pos.z + someVelocity[2];

View File

@ -27,7 +27,7 @@ void func_802B3B44(struct ShellActor* shell) {
f32 temp_f18_3;
f32 temp_f16_3;
f32 temp_f26;
Vec3f origPos;
Vec3fa origPos;
currentWaypoint = shell->pathIndex;
temp_f2 = D_80164490[currentWaypoint].posX;
@ -116,7 +116,7 @@ void func_802B3E7C(struct ShellActor* shell, Player* player) {
f32 x_velocity;
f32 z_velocity;
f32 xz_dist;
Vec3f newPosition;
Vec3fa newPosition;
x_velocity = player->pos.x;
x_velocity -= shell->pos.x;
@ -186,13 +186,13 @@ s16 func_802B3FD0(Player* owner, struct ShellActor* shell) {
}
void func_802B4104(struct ShellActor* shell) {
if ((shell->unk30.surfaceDistance[0] < 0.0f) &&
((shell->unk30.unk48[1] < 0.25f) || (shell->unk30.unk48[1] > -0.25f))) {
if ((shell->unk30.surfaceDistance.x < 0.0f) &&
((shell->unk30.unk48.y < 0.25f) || (shell->unk30.unk48.y > -0.25f))) {
destroy_destructable_actor((struct Actor*) shell);
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
shell->flags |= 0x80;
} else if ((shell->unk30.surfaceDistance[1] < 0.0f) &&
((shell->unk30.unk54[1] < 0.25f) || (shell->unk30.unk54[1] < -0.25f))) {
} else if ((shell->unk30.surfaceDistance.y < 0.0f) &&
((shell->unk30.unk54.y < 0.25f) || (shell->unk30.unk54.y < -0.25f))) {
destroy_destructable_actor((struct Actor*) shell);
func_800C98B8(shell->pos, shell->velocity, SOUND_ARG_LOAD(0x19, 0x00, 0x80, 0x54));
shell->flags |= 0x80;
@ -212,7 +212,7 @@ void update_actor_red_blue_shell(struct ShellActor* shell) {
f32 temp_f2;
s16 temp_v0;
UNUSED s16 pad3;
Vec3f somePosVel;
Vec3fa somePosVel;
struct Controller* controller;
TripleShellParent* parent;
UNUSED f32 pad0;
@ -232,7 +232,7 @@ void update_actor_red_blue_shell(struct ShellActor* shell) {
UNUSED f32 pad15;
UNUSED f32 pad16;
UNUSED f32 pad17;
Vec3f origPos;
Vec3fa origPos;
pad1 = shell->pos.x;
pad0 = shell->pos.z;
@ -324,7 +324,7 @@ void update_actor_red_blue_shell(struct ShellActor* shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = 0.0f;
somePosVel[2] = height;
func_802B64C4(somePosVel, (s16) (player->rotation[1] + player->unk_0C0));
func_802B64C4(somePosVel, (s16) (player->rotation.y + player->unk_0C0));
shell->velocity.x = somePosVel[0];
shell->velocity.y = somePosVel[1];
shell->velocity.z = somePosVel[2];

View File

@ -67,7 +67,7 @@ void update_actor_green_shell(struct ShellActor* shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = 0.0f;
somePosVel[2] = -var_f2;
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
func_802B64C4(somePosVel, player->rotation.y + player->unk_0C0);
shell->velocity.x = somePosVel[0];
shell->velocity.y = somePosVel[1];
shell->velocity.z = somePosVel[2];
@ -119,7 +119,7 @@ void update_actor_green_shell(struct ShellActor* shell) {
somePosVel[0] = 0.0f;
somePosVel[1] = 0.0f;
somePosVel[2] = var_f2;
func_802B64C4(somePosVel, player->rotation[1] + player->unk_0C0);
func_802B64C4(somePosVel, player->rotation.y + player->unk_0C0);
shell->velocity.x = somePosVel[0];
shell->velocity.y = somePosVel[1];
shell->velocity.z = somePosVel[2];

View File

@ -688,7 +688,7 @@ void func_800065D0(s32 playerId, Player* player) {
a = (s16) gPathIndexByPlayerId[playerId];
b = gNearestWaypointByPlayerId[playerId];
temp_t2 = (s16) ((s16) player->rotation[1] / 182);
temp_t2 = (s16) ((s16) player->rotation.y / 182);
temp_t3 = (s16) ((s16) D_80164590[a][b] / 182);
var_t1 = temp_t2 - temp_t3;
@ -1775,9 +1775,9 @@ void func_80009B60(s32 playerId) {
func_8000BBD8(stackPadding1A, D_80163090[playerId], D_80163448);
}
}
player->rotation[1] = -get_angle_between_two_vectors(player->pos, D_80162FA0);
player->rotation.y = -get_angle_between_two_vectors(player->pos, D_80162FA0);
} else {
player->rotation[1] = D_80164590[D_80163448][(D_801630E0 + 4) % D_80164430];
player->rotation.y = D_80164590[D_80163448][(D_801630E0 + 4) % D_80164430];
}
}
func_8003680C(player, 0);
@ -1900,8 +1900,8 @@ void func_80009B60(s32 playerId) {
// MISMATCH2
// This fixes part of the register allocation problems, makes fixing others
// harder though. Needs more investigation
// var_a2 = (-get_angle_between_two_vectors(player->pos, D_80162FA0)) - (var_a1 = player->rotation[1]);
stackPadding19 = -get_angle_between_two_vectors(player->pos, D_80162FA0) - player->rotation[1];
// var_a2 = (-get_angle_between_two_vectors(player->pos, D_80162FA0)) - (var_a1 = player->rotation.y);
stackPadding19 = -get_angle_between_two_vectors(player->pos, D_80162FA0) - player->rotation.y;
var_a1 = stackPadding19;
var_a2 = var_a1;
if ((s16) temp_f2 < var_a1) {
@ -4846,13 +4846,13 @@ void initialize_toads_turnpike_vehicle(f32 speedA, f32 speedB, s32 numVehicles,
} else {
veh->speed = speedB;
}
veh->rotation[0] = 0;
veh->rotation[2] = 0;
veh->rotation.x = 0;
veh->rotation.z = 0;
if (D_8016347A == 0) {
veh->rotation[1] = func_8000D6D0(veh->position, (s16*) &veh->waypointIndex, veh->speed,
veh->rotation.y = func_8000D6D0(veh->position, (s16*) &veh->waypointIndex, veh->speed,
veh->someMultiplierTheSequel, 0, 3);
} else {
veh->rotation[1] =
veh->rotation.y =
func_8000D940(veh->position, (s16*) &veh->waypointIndex, veh->speed, veh->someMultiplierTheSequel, 0);
}
}
@ -4931,14 +4931,14 @@ void update_vehicle_follow_waypoint(VehicleStuff* vehicle) {
var_a1 = func_8000D940(vehicle->position, (s16*) &vehicle->waypointIndex, vehicle->speed,
vehicle->someMultiplierTheSequel, 0);
}
adjust_angle(&vehicle->rotation[1], var_a1, 100);
adjust_angle(&vehicle->rotation.y, var_a1, 100);
temp_f0_3 = vehicle->position.x - sp5C;
temp_f2_2 = vehicle->position.z - sp54;
sp34[0] = vehicle->position.y;
sp34[1] = 0.0f;
sp34[2] = sqrtf((temp_f0_3 * temp_f0_3) + (temp_f2_2 * temp_f2_2));
thing = get_angle_between_two_vectors(sp40, sp34);
adjust_angle(&vehicle->rotation[0], -thing, 100);
adjust_angle(&vehicle->rotation.x, -thing, 100);
vehicle->velocity.x = vehicle->position.x - sp5C;
vehicle->velocity.y = vehicle->position.y - sp58;
vehicle->velocity.z = vehicle->position.z - sp54;
@ -4946,13 +4946,13 @@ void update_vehicle_follow_waypoint(VehicleStuff* vehicle) {
vehicleActor->pos.x = vehicle->position.x;
vehicleActor->pos.y = vehicle->position.y;
vehicleActor->pos.z = vehicle->position.z;
vehicleActor->rot.x = vehicle->rotation[0];
vehicleActor->rot.x = vehicle->rotation.x;
if (gIsMirrorMode != 0) {
vehicleActor->rot.y = -vehicle->rotation[1];
vehicleActor->rot.y = -vehicle->rotation.y;
} else {
vehicleActor->rot.y = vehicle->rotation[1];
vehicleActor->rot.y = vehicle->rotation.y;
}
vehicleActor->rot.z = vehicle->rotation[2];
vehicleActor->rot.z = vehicle->rotation.z;
vehicleActor->velocity.x = vehicle->velocity.x;
vehicleActor->velocity.y = vehicle->velocity.y;
vehicleActor->velocity.z = vehicle->velocity.z;
@ -5426,7 +5426,7 @@ void func_80015314(s32 playerId, UNUSED f32 arg1, s32 cameraId) {
temp_a0 = camera1;
temp_a1 += playerId;
temp_a0 += cameraId;
temp_a0->unk_2C = temp_a1->rotation[1];
temp_a0->unk_2C = temp_a1->rotation.y;
func_80015390(temp_a0, temp_a1, 0);
}
@ -5459,7 +5459,7 @@ void func_80015390(Camera* camera, UNUSED Player* player, UNUSED s32 arg2) {
var_a2 = 0xA0 + (temp_s1->unk_078 / 16);
}
if (!((temp_s1->effects & 0x80) || (temp_s1->effects & 0x40))) {
adjust_angle(&camera->unk_2C, temp_s1->rotation[1], var_a2);
adjust_angle(&camera->unk_2C, temp_s1->rotation.y, var_a2);
}
func_8001D794(temp_s1, camera, sp64, &sp84, &sp80, &sp7C, camera->unk_2C);
check_bounding_collision(&camera->collision, 10.0f, sp84, sp80, sp7C);
@ -7490,7 +7490,7 @@ void func_8001BE78(void) {
temp_s1->pos.y =
spawn_actor_on_surface((f32) temp_s0->posX, 2000.0f, (f32) temp_s0->posZ) + temp_s1->boundingBoxSize;
temp_s1->pos.z = (f32) temp_s0->posZ;
temp_s1->rotation[1] = (s16) *D_80164590[i];
temp_s1->rotation.y = (s16) *D_80164590[i];
func_8003680C(temp_s1, 0);
temp_s1++;
D_80163410[i] = 0;

File diff suppressed because it is too large Load Diff

View File

@ -615,25 +615,25 @@ extern u8* D_8018D4BC;
extern u8* D_8018D4C0;
extern u8* D_8018D4C4;
extern u8* D_8018D4C8;
extern Vec3f D_8018D4D0[];
extern Vec3f D_8018D530[];
extern Vec3f D_8018D590[];
extern Vec3fa D_8018D4D0[];
extern Vec3fa D_8018D530[];
extern Vec3fa D_8018D590[];
extern u16 gPlayerBalloonStatus[8][3];
extern Vec3s D_8018D620[];
extern Vec3f D_8018D650[];
extern Vec3f D_8018D6B0[];
extern Vec3sa D_8018D620[];
extern Vec3fa D_8018D650[];
extern Vec3fa D_8018D6B0[];
extern Vec3f D_8018D710[];
extern Vec3s D_8018D770[];
extern Vec3s D_8018D7A0[];
extern Vec3s D_8018D7D0[];
extern Vec3fa D_8018D710[];
extern Vec3sa D_8018D770[];
extern Vec3sa D_8018D7A0[];
extern Vec3sa D_8018D7D0[];
extern Vec3s D_8018D800[];
extern Vec3s D_8018D830[];
extern Vec3s D_8018D860[];
extern Vec3s D_8018D890[];
extern Vec3sa D_8018D800[];
extern Vec3sa D_8018D830[];
extern Vec3sa D_8018D860[];
extern Vec3sa D_8018D890[];
extern s16 gPlayerBalloonCount[]; // D_8018D8C0
extern Vec3s D_8018D8D0[];
extern Vec3sa D_8018D8D0[];
/** @endcond */

View File

@ -204,21 +204,21 @@ u8* D_8018D4BC;
u8* D_8018D4C0;
u8* D_8018D4C4;
u8* D_8018D4C8;
Vec3f D_8018D4D0[8];
Vec3f D_8018D530[8];
Vec3f D_8018D590[8];
Vec3fa D_8018D4D0[8];
Vec3fa D_8018D530[8];
Vec3fa D_8018D590[8];
u16 gPlayerBalloonStatus[8][3];
Vec3s D_8018D620[8];
Vec3f D_8018D650[8];
Vec3f D_8018D6B0[8];
Vec3f D_8018D710[8];
Vec3s D_8018D770[8];
Vec3s D_8018D7A0[8];
Vec3s D_8018D7D0[8];
Vec3fa D_8018D650[8];
Vec3fa D_8018D6B0[8];
Vec3fa D_8018D710[8];
Vec3sa D_8018D770[8];
Vec3sa D_8018D7A0[8];
Vec3sa D_8018D7D0[8];
Vec3s D_8018D800[8];
Vec3s D_8018D830[8];
Vec3s D_8018D860[8];
Vec3s D_8018D890[8];
Vec3sa D_8018D800[8];
Vec3sa D_8018D830[8];
Vec3sa D_8018D860[8];
Vec3sa D_8018D890[8];
s16 gPlayerBalloonCount[8];
Vec3s D_8018D8D0[8];
Vec3sa D_8018D8D0[8];

View File

@ -268,7 +268,7 @@ void func_8008C73C(Player* player, s8 arg1) {
player->unk_0B6 |= 0x80;
// clang-format off
player->unk_0C0 = 0; player->unk_07C = 0; player->unk_078 = 0; player->unk_0AE = player->rotation[1]; player->unk_0B2 = 2;
player->unk_0C0 = 0; player->unk_07C = 0; player->unk_078 = 0; player->unk_0AE = player->rotation.y; player->unk_0B2 = 2;
// clang-format on
D_80165190[0][arg1] = 1;
D_80165190[1][arg1] = 1;
@ -294,7 +294,7 @@ void func_8008C8C4(Player* player, s8 playerId) {
player->effects &= ~0x80;
player->effects &= ~0x40;
player->unk_0A8 = 0;
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->effects &= ~0x800;
@ -335,7 +335,7 @@ void func_8008C9EC(Player* player, s8 arg1) {
}
}
if ((player->effects & 0x80) == 0x80) {
player->rotation[1] -= sp30[player->unk_0B2];
player->rotation.y -= sp30[player->unk_0B2];
D_8018D920[arg1] -= sp30[player->unk_0B2];
stackPadding1 = (u16) D_8018D920[arg1] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182)));
if (stackPadding1 == 0) {
@ -348,7 +348,7 @@ void func_8008C9EC(Player* player, s8 arg1) {
}
}
} else {
player->rotation[1] += sp30[player->unk_0B2];
player->rotation.y += sp30[player->unk_0B2];
D_8018D920[arg1] -= sp30[player->unk_0B2];
stackPadding2 = (u16) D_8018D920[arg1] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182)));
if (stackPadding2 == 0) {
@ -556,7 +556,7 @@ void remove_boost_effect(Player* player) {
void func_8008D570(Player* player, s8 arg1) {
clean_effect(player, arg1);
player->unk_0AE = player->rotation[1];
player->unk_0AE = player->rotation.y;
player->effects |= 0x80000;
player->effects &= ~0x10;
player->soundEffects &= ~0x1000;
@ -584,10 +584,10 @@ void func_8008D698(Player* player, s8 arg1) {
s16 temp;
if (player->unk_0B2 == 0) {
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
temp = 0;
} else {
player->rotation[1] -= 1820;
player->rotation.y -= 1820;
D_8018D920[arg1] -= 1820;
temp = ((u16) D_8018D920[arg1] / 1820);
}
@ -606,7 +606,7 @@ void func_8008D760(Player* player) {
player->unk_0A8 = 0;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
player->effects &= 0xFFF7FFFF;
player->kartGravity = gKartGravityTable[player->characterId];
player->type &= 0xFF7F;
@ -615,7 +615,7 @@ void func_8008D760(Player* player) {
void func_8008D7B0(Player* player, s8 arg1) {
clean_effect(player, arg1);
player->unk_0AE = player->rotation[1];
player->unk_0AE = player->rotation.y;
player->effects |= 0x800000;
player->effects &= ~0x10;
player->soundEffects &= ~0x20000;
@ -638,10 +638,10 @@ void func_8008D8B4(Player* player, s8 arg1) {
s16 temp;
if (player->unk_0B2 == 0) {
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
temp = 0;
} else {
player->rotation[1] -= 1820;
player->rotation.y -= 1820;
D_8018D920[arg1] -= 1820;
temp = ((u16) (D_8018D920[arg1]) / 1820);
}
@ -660,7 +660,7 @@ void func_8008D97C(Player* player) {
player->unk_0A8 = 0;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
player->effects &= 0xFF7FFFFF;
player->kartGravity = gKartGravityTable[player->characterId];
}
@ -837,7 +837,7 @@ void apply_hit_rotating_sound_effect(Player* player, s8 arg1) {
player->unk_0B0 = 0;
player->size = 1.0f;
D_8018D930[arg1] = gCourseTimer;
player->unk_0AE = player->rotation[1];
player->unk_0AE = player->rotation.y;
player->unk_0B2 = 2;
player->unk_0C0 = 0;
player->unk_07C = 0;
@ -868,7 +868,7 @@ void apply_lightning_effect(Player* player, s8 arg1) {
player->unk_0A8 = 0;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
remove_lightning_effect(player, arg1);
D_80165190[0][arg1] = 1;
D_80165190[1][arg1] = 1;
@ -876,7 +876,7 @@ void apply_lightning_effect(Player* player, s8 arg1) {
D_80165190[3][arg1] = 1;
apply_hit_sound_effect(player, arg1);
} else if ((player->effects & 0x20000) == 0x20000) {
player->rotation[1] -= 0x5B0;
player->rotation.y -= 0x5B0;
D_8018D920[arg1] -= 0x5B0;
test = (u16) D_8018D920[arg1] / 1456;
if (test == 0) {
@ -886,7 +886,7 @@ void apply_lightning_effect(Player* player, s8 arg1) {
player->effects &= ~0x20000;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
D_80165190[0][arg1] = 1;
D_80165190[1][arg1] = 1;
D_80165190[2][arg1] = 1;
@ -925,7 +925,7 @@ void remove_lightning_effect(Player* player, UNUSED s8 arg1) {
player->effects |= 0x08000000;
if ((player->effects & 0x20000) == 0x20000) {
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
}
player->effects &= ~0x20000;
@ -1238,7 +1238,7 @@ void remove_boost_ramp_wood_effect(Player* player) {
void func_8008F104(Player* player, s8 arg1) {
clean_effect(player, arg1);
player->unk_0AE = player->rotation[1];
player->unk_0AE = player->rotation.y;
player->unk_0B2 = 2;
player->unk_0C0 = 0;
player->unk_07C = 0;
@ -1258,7 +1258,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
player->unk_08C = (player->unk_210 * 0.05);
if (player->unk_0B2 < 0) {
if ((player->unk_044 & 0x80) == 0x80) {
player->rotation[1] += 182;
player->rotation.y += 182;
D_8018D920[arg1] += 182;
temp = ((u16) D_8018D920[arg1] / 182);
@ -1269,7 +1269,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
}
} else {
player->rotation[1] -= 182;
player->rotation.y -= 182;
D_8018D920[arg1] -= 182;
temp = ((u16) D_8018D920[arg1] / 182);
if (temp == 180) {
@ -1280,7 +1280,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
}
} else {
if ((player->unk_0B2 & 1) != 0) {
player->rotation[1] -= 364;
player->rotation.y -= 364;
D_8018D920[arg1] -= 364;
temp = ((u16) D_8018D920[arg1] / 364);
if (temp < 71) {
@ -1290,7 +1290,7 @@ void func_8008F1B8(Player* player, s8 arg1) {
player->unk_044 &= ~0x40;
return;
}
player->rotation[1] += 364;
player->rotation.y += 364;
D_8018D920[arg1] += 364;
temp = ((u16) D_8018D920[arg1] / 364);
if (temp >= 110) {
@ -1774,7 +1774,7 @@ void func_80090778(Player* player) {
player->unk_0A8 = 0;
player->unk_07C = 0;
player->unk_0C0 = 0;
player->rotation[1] = player->unk_0AE;
player->rotation.y = player->unk_0AE;
}
remove_lightning_effect(player, playerIndex);
}
@ -1883,7 +1883,7 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
case 2:
func_80090178(player, playerId, sp44, sp38);
// Fakematch found by Verti, who knows what's going on here
player->rotation[1] = (u16) -get_angle_between_two_vectors(sp44, sp38) & 0xFFFF;
player->rotation.y = (u16) -get_angle_between_two_vectors(sp44, sp38) & 0xFFFF;
player->pos.x = sp44[0];
player->pos.y = sp44[1] + 40.0f;
player->pos.z = sp44[2];
@ -1898,8 +1898,8 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
player->pos.x = sp44[0];
player->pos.y = sp44[1] + 40.0f;
player->pos.z = sp44[2];
player->pos.z = player->pos.z + coss((playerId * 0x1C70) - player->rotation[1]) * -5.0f;
player->pos.x = player->pos.x + sins((playerId * 0x1C70) - player->rotation[1]) * -5.0f;
player->pos.z = player->pos.z + coss((playerId * 0x1C70) - player->rotation.y) * -5.0f;
player->pos.x = player->pos.x + sins((playerId * 0x1C70) - player->rotation.y) * -5.0f;
player->unk_0C6 += 8;
if (player->unk_0C6 >= 0xF0) {
player->unk_0C6 = 0x00FF;
@ -1910,8 +1910,8 @@ void func_80090970(Player* player, s8 playerId, s8 arg2) {
break;
case 4:
if ((player->unk_0C8 == 0x0096) || (player->unk_0C8 == 0x00C8) || (player->unk_0C8 == 0x00FA)) {
player->pos.z = player->pos.z + coss(-player->rotation[1]) * -10.0f;
player->pos.x = player->pos.x + sins(-player->rotation[1]) * -10.0f;
player->pos.z = player->pos.z + coss(-player->rotation.y) * -10.0f;
player->pos.x = player->pos.x + sins(-player->rotation.y) * -10.0f;
}
if (player->unk_0C8 == 0x00FC) {
waypoint = D_80164550[0];
@ -2002,7 +2002,7 @@ bool prevent_item_use(Player* player) {
void func_800911B4(Player* player, s8 arg1) {
s32 temp_v0;
player->unk_0AE = player->rotation[1];
player->unk_0AE = player->rotation.y;
player->unk_044 |= 0x1800;
player->unk_044 &= ~0x0400;
player->unk_044 |= 0x2000;
@ -2051,7 +2051,7 @@ void func_80091298(Player* player, s8 arg1) {
if (player->unk_0B2 == 0) {
var_v1 = 0;
} else {
player->rotation[1] -= 0xE38;
player->rotation.y -= 0xE38;
D_8018D920[arg1] -= 0xE38;
var_v1 = (u16) D_8018D920[arg1] / 3640;
}

View File

@ -153,7 +153,7 @@ void OTrophy::Tick() { // func_80086D80
// Get the player's yaw
Player *player = &gPlayers[0];
float yaw = (player->rotation[1] + 0x4000) * (M_PI / 32768.0f); // Convert degrees to radians
float yaw = (player->rotation.y + 0x4000) * (M_PI / 32768.0f); // Convert degrees to radians
// Calculate forward direction based on yaw (same as before)
float lookAtX = player->pos.x + cos(yaw);

View File

@ -727,7 +727,7 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) {
player->unk_048[screenId] = atan2s(player->pos.x - camera->pos.x, player->pos.z - camera->pos.z);
player->animFrameSelector[screenId] =
(u16) ((((player->unk_048[screenId]) + player->rotation[1] + player->unk_0C0))) / 128;
(u16) ((((player->unk_048[screenId]) + player->rotation.y + player->unk_0C0))) / 128;
temp_f2 = (gCharacterSize[player->characterId] * 18.0f) * player->size;
temp_f0 = player->unk_230 - player->unk_23C;
@ -756,7 +756,7 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) {
player->unk_0D4[screenId] = (s16) ((s32) player->unk_D9C);
}
func_80029200(player, screenId);
temp_a0 = ((player->unk_048[screenId] + player->rotation[1]) + player->unk_0C0);
temp_a0 = ((player->unk_048[screenId] + player->rotation.y) + player->unk_0C0);
temp_a0 = (s16) player->unk_0D4[screenId] * sins((u16) temp_a0) + player->unk_0CC[screenId] * coss((u16) temp_a0);
move_s16_towards(&player->unk_050[screenId], temp_a0, 0.5f);
var_a0 = player->animFrameSelector[screenId];
@ -786,7 +786,7 @@ void func_8002934C(Player* player, Camera* camera, s8 screenId, s8 playerId) {
if (((player->effects & 8) == 8) && ((player->unk_0CA & 2) == 2)) {
player->unk_050[screenId] = 0;
}
var_a0 = (player->unk_048[screenId] + player->rotation[1] + player->unk_0C0);
var_a0 = (player->unk_048[screenId] + player->rotation.y + player->unk_0C0);
if (((player->effects & 0x80) == 0x80) || ((player->effects & 0x40) == 0x40) ||
((player->effects & 0x80000) == 0x80000) || ((player->effects & 0x800000) == 0x800000) ||
((player->effects & 0x20000) == 0x20000) || (player->unk_044 & 0x800)) {
@ -874,7 +874,7 @@ void func_80029B4C(Player* player, UNUSED f32 arg1, f32 arg2, UNUSED f32 arg3) {
var_f12 = 18.0f * (gCharacterSize[player->characterId] / 2);
}
calculate_orientation_matrix(sp5C, 0.0f, 1.0f, 0.0f, (player->rotation[1] + player->unk_0C0));
calculate_orientation_matrix(sp5C, 0.0f, 1.0f, 0.0f, (player->rotation.y + player->unk_0C0));
sp8C[0] = var_f12 - 3.6;
sp8C[1] = -player->boundingBoxSize;
sp8C[2] = var_f12 - 2.0f;
@ -978,7 +978,7 @@ void func_8002A194(Player* player, f32 arg1, f32 arg2, f32 arg3) {
UNUSED s32 pad2;
f32 temp_f0;
temp_v1 = -player->rotation[1] - player->unk_0C0;
temp_v1 = -player->rotation.y - player->unk_0C0;
if ((player->effects & LIGHTNING_EFFECT) == LIGHTNING_EFFECT) {
var_f20 = (((gCharacterSize[player->characterId] * 18) / 2) * (player->size * 1.5)) - 1;
} else {
@ -1282,8 +1282,8 @@ void func_8002AE38(Player* player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar
s16 temp_a0;
s32 var_v1;
sp28 = (sins(-player->rotation[1]) * player->unk_094) + arg2;
temp_f16 = (coss(-player->rotation[1]) * player->unk_094) + arg3;
sp28 = (sins(-player->rotation.y) * player->unk_094) + arg2;
temp_f16 = (coss(-player->rotation.y) * player->unk_094) + arg3;
if (((player->effects & 0x800) != 0x800) && ((player->effects & 0x10) != 0x10) && !(player->unk_044 & 0x4000) &&
((((player->unk_094 / 18.0f) * 216.0f) <= 8.0f) ||
(((player->unk_07C >> 0x10) < 5) && ((player->unk_07C >> 0x10) > -5)))) {
@ -1550,7 +1550,7 @@ void func_8002B9CC(Player* player, s8 arg1, UNUSED s32 arg2) {
}
}
temp = (-(s16) get_angle_between_two_vectors(player->pos, &player->oldPos[0]));
temp2 = (player->rotation[1] - player->unk_0C0);
temp2 = (player->rotation.y - player->unk_0C0);
temp = temp - temp2;
player->unk_234 = temp / 182;
}
@ -1592,7 +1592,7 @@ void func_8002BB9C(Player* player, f32* arg1, f32* arg2, UNUSED s8 arg3, UNUSED
mtxf_translate_vec3f_mat3(sp4C, sp64);
var_v0 = -(s16) get_angle_between_two_vectors(sp58, sp4C);
t0 = player->rotation[1];
t0 = player->rotation.y;
var_v0 = 0x10000 + (t0 - var_v0);
var_v0 /= 182;
@ -1611,9 +1611,9 @@ void func_8002BB9C(Player* player, f32* arg1, f32* arg2, UNUSED s8 arg3, UNUSED
}
if ((player->unk_07C >> 0x10) < 0) {
player->rotation[1] -= sp30[var_v0];
player->rotation.y -= sp30[var_v0];
} else {
player->rotation[1] += sp30[var_v0];
player->rotation.y += sp30[var_v0];
}
}
@ -2001,7 +2001,7 @@ void func_8002D028(Player* player, s8 arg1) {
sp4C[2] = D_80165230[D_80165270[arg1]];
temp = -(s16) get_angle_between_two_vectors(player->pos, sp4C);
temp2 = player->rotation[1];
temp2 = player->rotation.y;
temp = (temp - temp2);
thing0 = 8;
@ -2020,8 +2020,8 @@ void func_8002D028(Player* player, s8 arg1) {
temp_f18 = sqrtf((sp4C[0] - player->pos.x) * (sp4C[0] - player->pos.x) +
(sp4C[2] - player->pos.z) * (sp4C[2] - player->pos.z));
if (temp_f18 <= 8.0f) {
adjust_angle(&player->rotation[1], -0x8000, 0x016C);
if ((player->rotation[1] < (-0x7F41)) || (player->rotation[1] > 0x7F41)) {
adjust_angle(&player->rotation.y, -0x8000, 0x016C);
if ((player->rotation.y < (-0x7F41)) || (player->rotation.y > 0x7F41)) {
player->type &= ~0x0200;
}
player->unk_08C = 0;
@ -2117,8 +2117,8 @@ 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->oldPos[2] - player->pos.z) * coss(player->rotation[1] + player->unk_0C0)) +
(-(player->oldPos[0] - player->pos.x) * sins(player->rotation[1] + player->unk_0C0));
temp_f2_2 = ((player->oldPos[2] - player->pos.z) * coss(player->rotation.y + player->unk_0C0)) +
(-(player->oldPos[0] - player->pos.x) * sins(player->rotation.y + player->unk_0C0));
if (temp_f2_2 > 0.1) {
player->unk_044 |= 8;
} else {
@ -2206,10 +2206,10 @@ void func_8002D268(Player* player, UNUSED Camera* camera, s8 screenId, s8 player
player->unk_05C = 1.0f;
if ((player->unk_044 & 1) != 1) {
calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060,
player->rotation[1]);
player->rotation.y);
} else {
calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060,
player->rotation[1] + 0x8000);
player->rotation.y + 0x8000);
}
player->effects |= 8;
player->unk_0C2 += 1;
@ -2426,12 +2426,12 @@ void func_8002E594(Player* player, UNUSED Camera* camera, s8 screenId, s8 player
func_8002C7E4(player, playerId, screenId);
if (sp46 == 1) {
calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060,
(s16) ((s32) player->rotation[1]));
(s16) ((s32) player->rotation.y));
calculate_orientation_matrix(player->unk_150, player->unk_058, player->unk_05C, player->unk_060,
(s16) ((s32) player->unk_0AE));
} else {
calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060,
(s16) ((s32) player->rotation[1]));
(s16) ((s32) player->rotation.y));
}
spEC[2] = func_80030150(player, playerId);
if (sp46 == 1) {
@ -2670,7 +2670,7 @@ void control_kart_ai_movement(Player* player, UNUSED Camera* camera, s8 arg2, s8
player->kartHopAcceleration = 0;
player->kartHopVelocity = 0;
calculate_orientation_matrix(player->orientationMatrix, player->unk_058, player->unk_05C, player->unk_060,
player->rotation[1]);
player->rotation.y);
player->unk_0C2 = 0;
player->effects &= ~2;
player->effects &= ~8;
@ -2757,7 +2757,7 @@ void func_8002F730(Player* player, UNUSED Camera* camera, UNUSED s8 screenId, s8
player->unk_058 = 0.0f;
player->unk_05C = 1.0f;
player->unk_060 = 0.0f;
calculate_orientation_matrix(player->orientationMatrix, 0.0f, 1.0f, 0.0f, (s16) (s32) player->rotation[1]);
calculate_orientation_matrix(player->orientationMatrix, 0.0f, 1.0f, 0.0f, (s16) (s32) player->rotation.y);
player->effects &= ~8;
sp78 = player->collision.surfaceDistance[2];
if (sp78 <= 0.0f) {
@ -4454,7 +4454,7 @@ void func_80037BB4(Player* player, Vec3f arg1) {
} else {
if (player->unk_078 < 0) {
if (((player->effects & 0x20000000) != 0x20000000) || (player->unk_228 >= 0x64)) {
player->rotation[1] += player->unk_078;
player->rotation.y += player->unk_078;
}
if (!(player->type & PLAYER_KART_AI)) {
if (gModeSelection == BATTLE) {
@ -4467,7 +4467,7 @@ void func_80037BB4(Player* player, Vec3f arg1) {
}
} else {
if (((player->effects & 0x20000000) != 0x20000000) || (player->unk_228 >= 0x64)) {
player->rotation[1] += player->unk_078;
player->rotation.y += player->unk_078;
}
if (!(player->type & PLAYER_KART_AI)) {
if (gModeSelection == BATTLE) {
@ -4817,7 +4817,7 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId)
player->topSpeed = 250.0f;
func_8002B830(player, playerId, arg2);
apply_effect(player, playerId, arg2);
player->rotation[1] += player->unk_078;
player->rotation.y += player->unk_078;
spF0[0] = 0;
spF0[1] = 0;
spF0[2] = 0;
@ -4864,7 +4864,7 @@ void func_80038C6C(Player* player, UNUSED Camera* camera, s8 arg2, s8 playerId)
player->unk_058 = 0;
player->unk_060 = 0;
player->unk_05C = 1.0f;
calculate_orientation_matrix(player->orientationMatrix, 0, 1.0f, 0, player->rotation[1]);
calculate_orientation_matrix(player->orientationMatrix, 0, 1.0f, 0, player->rotation.y);
player->effects |= 8;
player->unk_0C2 += 1;
sp98 = player->collision.surfaceDistance[2];

View File

@ -194,7 +194,7 @@ void func_802B0788(s16 rawStickY, struct BananaBunchParent* banana_bunch, Player
var_f12 = (player->unk_094 * 0.75f) + 4.5f + var_f0;
}
vec3f_set(velocity, 0.0f, var_f0, var_f12);
func_802B64C4(velocity, player->rotation[1] + player->unk_0C0);
func_802B64C4(velocity, player->rotation.y + player->unk_0C0);
banana->velocity.x = velocity.x;
banana->velocity.y = velocity.y;
banana->velocity.z = velocity.z;
@ -432,7 +432,7 @@ void update_actor_triple_shell(TripleShellParent* parent, s16 shellType) {
someVelocity[0] = 0;
someVelocity[1] = 0;
someVelocity[2] = 8;
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation.y + player->unk_0C0);
shell->velocity.x = someVelocity[0];
shell->velocity.y = someVelocity[1];
shell->velocity.z = someVelocity[2];
@ -458,7 +458,7 @@ void update_actor_triple_shell(TripleShellParent* parent, s16 shellType) {
someVelocity[0] = 0;
someVelocity[1] = 0;
someVelocity[2] = 8;
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation.y + player->unk_0C0);
shell->velocity.x = someVelocity[0];
shell->velocity.y = someVelocity[1];
shell->velocity.z = someVelocity[2];
@ -484,7 +484,7 @@ void update_actor_triple_shell(TripleShellParent* parent, s16 shellType) {
someVelocity[0] = 0;
someVelocity[1] = 0;
someVelocity[2] = 8;
func_802B64C4(someVelocity, player->rotation[1] + player->unk_0C0);
func_802B64C4(someVelocity, player->rotation.y + player->unk_0C0);
shell->velocity.x = someVelocity[0];
shell->velocity.y = someVelocity[1];
shell->velocity.z = someVelocity[2];
@ -673,7 +673,7 @@ s32 use_red_shell_item(Player* player) {
func_802B4E30((struct Actor*) shell);
shell->state = HELD_SHELL;
shell->rotVelocity = 0;
shell->rotAngle = player->rotation[1] - 0x8000;
shell->rotAngle = player->rotation.y - 0x8000;
shell->playerId = player - gPlayerOne;
return actorIndex;
}

View File

@ -2791,21 +2791,21 @@ void func_8004F168(s32 arg0, s32 playerId, s32 characterId) {
if (characterId != 8) {
if ((gGPCurrentRaceRankByPlayerId[playerId] == 0) && (gModeSelection != 3) && (gModeSelection != 1)) {
#if EXPLICIT_AND == 1
func_80046424(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
func_80046424(temp_a0, temp_a1, (player->rotation.y + 0x8000) & 0xFFFF, 1.0f,
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
8, 8, 8, 8);
#else
func_80046424(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f,
func_80046424(temp_a0, temp_a1, player->rotation.y + 0x8000, 1.0f,
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
8, 8, 8, 8);
#endif
} else {
#if EXPLICIT_AND == 1
func_800463B0(temp_a0, temp_a1, (player->rotation[1] + 0x8000) & 0xFFFF, 1.0f,
func_800463B0(temp_a0, temp_a1, (player->rotation.y + 0x8000) & 0xFFFF, 1.0f,
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
8, 8, 8, 8);
#else
func_800463B0(temp_a0, temp_a1, player->rotation[1] + 0x8000, 1.0f,
func_800463B0(temp_a0, temp_a1, player->rotation.y + 0x8000, 1.0f,
(u8*) common_texture_minimap_kart_character[characterId], common_vtx_player_minimap_icon,
8, 8, 8, 8);
#endif