diff options
| author | Maciek Baron <1668712+MaciekBaron@users.noreply.github.com> | 2025-07-03 13:35:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-03 06:35:42 -0600 |
| commit | 99689a3f70d8cb38178f92b87ecdcdbbdb200429 (patch) | |
| tree | 031bbf96ac4c1d17b2f6213b1c6f271a71bb8e2d /src/racing | |
| parent | 7937896598f3df46eb78c158bde787bc4f12ad7f (diff) | |
Document player alpha (#396)
* Document player alpha
* Fix typo
* Document further alpha things
* Document movement
* Fix indentation
Diffstat (limited to 'src/racing')
| -rw-r--r-- | src/racing/actors.c | 30 | ||||
| -rw-r--r-- | src/racing/math_util.c | 32 |
2 files changed, 31 insertions, 31 deletions
diff --git a/src/racing/actors.c b/src/racing/actors.c index 17742bf03..87c6e8231 100644 --- a/src/racing/actors.c +++ b/src/racing/actors.c @@ -420,18 +420,18 @@ void func_80297760(struct Actor* arg0, Vec3f arg1) { arg1[1] = calculate_surface_height(arg1[0], arg1[1], arg1[2], arg0->unk30.meshIndexZX); } -void func_802977B0(Player* arg0) { - arg0->tyres[FRONT_RIGHT].unk_14 |= 2; - arg0->tyres[FRONT_LEFT].unk_14 |= 2; - arg0->tyres[BACK_RIGHT].unk_14 |= 2; - arg0->tyres[BACK_LEFT].unk_14 |= 2; +void func_802977B0(Player* player) { + player->tyres[FRONT_RIGHT].unk_14 |= 2; + player->tyres[FRONT_LEFT].unk_14 |= 2; + player->tyres[BACK_RIGHT].unk_14 |= 2; + player->tyres[BACK_LEFT].unk_14 |= 2; } -void func_802977E4(Player* arg0) { - arg0->tyres[FRONT_RIGHT].unk_14 &= ~2 & 0xFFFF; - arg0->tyres[FRONT_LEFT].unk_14 &= ~2 & 0xFFFF; - arg0->tyres[BACK_RIGHT].unk_14 &= ~2 & 0xFFFF; - arg0->tyres[BACK_LEFT].unk_14 &= ~2 & 0xFFFF; +void func_802977E4(Player* player) { + player->tyres[FRONT_RIGHT].unk_14 &= ~2 & 0xFFFF; + player->tyres[FRONT_LEFT].unk_14 &= ~2 & 0xFFFF; + player->tyres[BACK_RIGHT].unk_14 &= ~2 & 0xFFFF; + player->tyres[BACK_LEFT].unk_14 &= ~2 & 0xFFFF; } // Generate the red shell tlut by invert green the green one @@ -1740,29 +1740,29 @@ bool collision_tree(Player* player, struct Actor* actor) { return true; } -bool query_collision_player_vs_actor_item(Player* arg0, struct Actor* arg1) { +bool query_collision_player_vs_actor_item(Player* player, struct Actor* arg1) { f32 temp_f0; f32 dist; f32 yDist; f32 zDist; f32 xDist; - temp_f0 = arg0->boundingBoxSize + arg1->boundingBoxSize; - xDist = arg1->pos[0] - arg0->pos[0]; + temp_f0 = player->boundingBoxSize + arg1->boundingBoxSize; + xDist = arg1->pos[0] - player->pos[0]; if (temp_f0 < xDist) { return NO_COLLISION; } if (xDist < -temp_f0) { return NO_COLLISION; } - yDist = arg1->pos[1] - arg0->pos[1]; + yDist = arg1->pos[1] - player->pos[1]; if (temp_f0 < yDist) { return NO_COLLISION; } if (yDist < -temp_f0) { return NO_COLLISION; } - zDist = arg1->pos[2] - arg0->pos[2]; + zDist = arg1->pos[2] - player->pos[2]; if (temp_f0 < zDist) { return NO_COLLISION; } diff --git a/src/racing/math_util.c b/src/racing/math_util.c index 69d5c0cbc..05baecf3f 100644 --- a/src/racing/math_util.c +++ b/src/racing/math_util.c @@ -1205,7 +1205,7 @@ UNUSED void func_802B8414(uintptr_t addr, Mat4 arg1, s16 arg2, s16 arg3, s32 arg #ifdef MIPS_TO_C // generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Oct-29-2023 -void func_802B8614(Player* arg0) { +void func_802B8614(Player* player) { f64 sp78; f64 sp70; f64 sp68; @@ -1224,16 +1224,16 @@ void func_802B8614(Player* arg0) { f64 temp_f4; f64 temp_f6; - temp_f6 = (f64) arg0->tyres[FRONT_RIGHT].pos[0]; + temp_f6 = (f64) player->tyres[FRONT_RIGHT].pos[0]; sp78 = temp_f6; - sp70 = (f64) arg0->tyres[FRONT_RIGHT].baseHeight; - sp68 = (f64) arg0->tyres[FRONT_RIGHT].pos[2]; - temp_f30 = (f64) arg0->tyres[FRONT_LEFT].pos[0]; - sp58 = (f64) arg0->tyres[FRONT_LEFT].baseHeight; - sp50 = (f64) arg0->tyres[FRONT_LEFT].pos[2]; - sp48 = (f64) arg0->tyres[BACK_RIGHT].pos[0]; - sp40 = (f64) arg0->tyres[BACK_RIGHT].baseHeight; - temp_f4 = (f64) arg0->tyres[BACK_RIGHT].pos[2]; + sp70 = (f64) player->tyres[FRONT_RIGHT].baseHeight; + sp68 = (f64) player->tyres[FRONT_RIGHT].pos[2]; + temp_f30 = (f64) player->tyres[FRONT_LEFT].pos[0]; + sp58 = (f64) player->tyres[FRONT_LEFT].baseHeight; + sp50 = (f64) player->tyres[FRONT_LEFT].pos[2]; + sp48 = (f64) player->tyres[BACK_RIGHT].pos[0]; + sp40 = (f64) player->tyres[BACK_RIGHT].baseHeight; + temp_f4 = (f64) player->tyres[BACK_RIGHT].pos[2]; temp_f2 = sp58 - sp70; sp38 = temp_f4; temp_f12 = temp_f4 - sp50; @@ -1242,14 +1242,14 @@ void func_802B8614(Player* arg0) { temp_f18 = sp48 - temp_f30; temp_f20 = temp_f30 - temp_f6; if (0.0 == 0.0) { - arg0->unk_058 = 0.0f; - arg0->unk_060 = 0.0f; - arg0->unk_05C = 1.0f; + player->unk_058 = 0.0f; + player->unk_060 = 0.0f; + player->unk_05C = 1.0f; return; } - arg0->unk_058 = (f32) ((f64) (f32) ((temp_f2 * temp_f12) - (temp_f14 * temp_f16)) / 0.0); - arg0->unk_05C = (f32) ((f64) (f32) ((temp_f14 * temp_f18) - (temp_f20 * temp_f12)) / 0.0); - arg0->unk_060 = (f32) ((f64) (f32) ((temp_f20 * temp_f16) - (temp_f2 * temp_f18)) / 0.0); + player->unk_058 = (f32) ((f64) (f32) ((temp_f2 * temp_f12) - (temp_f14 * temp_f16)) / 0.0); + player->unk_05C = (f32) ((f64) (f32) ((temp_f14 * temp_f18) - (temp_f20 * temp_f12)) / 0.0); + player->unk_060 = (f32) ((f64) (f32) ((temp_f20 * temp_f16) - (temp_f2 * temp_f18)) / 0.0); } #else GLOBAL_ASM("asm/non_matchings/racing/math_util/func_802B8614.s") |
