diff --git a/include/z_lib.h b/include/z_lib.h index c2e36e7cc3a..eb2d6459814 100644 --- a/include/z_lib.h +++ b/include/z_lib.h @@ -9,7 +9,7 @@ void Lib_MemSet(u8* dest, size_t len, u8 val); f32 Math_CosS(s16 angle); f32 Math_SinS(s16 angle); -s32 Math_ScaledStepToS(s16* pValue, s16 target, s16 step); +s32 Math_RotationStepToS(s16* pValue, s16 target, s16 step); s32 Math_StepToS(s16* pValue, s16 target, s16 step); s32 Math_StepToF(f32* pValue, f32 target, f32 step); s32 Math_StepUntilAngleS(s16* pValue, s16 limit, s16 step); diff --git a/src/code/z_lib.c b/src/code/z_lib.c index b9aa15ca4bf..79838e163ef 100644 --- a/src/code/z_lib.c +++ b/src/code/z_lib.c @@ -48,9 +48,12 @@ f32 Math_SinS(s16 angle) { /** * Changes pValue by step (scaled by the update rate) towards target, setting it equal when the target is reached. - * Returns true when target is reached, false otherwise. + * This is used for rotations, as it handles the fact that XYZ rotations are stored as signed integers, i.e. + * 32,727 is followed by -32,728 when rotating in a circle, and will correctly adjust the step if the change + * crosses this boundary. + * @return true when target is reached, false otherwise. */ -s32 Math_ScaledStepToS(s16* pValue, s16 target, s16 step) { +s32 Math_RotationStepToS(s16* pValue, s16 target, s16 step) { if (step != 0) { f32 updateScale = R_UPDATE_RATE * 0.5f; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 426fe0b2171..338e53d8293 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -354,7 +354,7 @@ void BgBdanObjects_OctoPlatform_BattleInProgress(BgBdanObjects* this, PlayState* } void BgBdanObjects_SinkToFloorHeight(BgBdanObjects* this, PlayState* play) { - s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x200); + s32 cond = Math_RotationStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x200); if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -125.0f, 3.0f)) { if (cond) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index f81b757a33d..b3c69b00a62 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -267,12 +267,12 @@ void BgHakaGate_FloorOpen(BgHakaGate* this, PlayState* play) { this->vTimer--; } if (this->vTimer == 0) { - if (Math_ScaledStepToS(&this->vOpenAngle, 0, 0x800)) { + if (Math_RotationStepToS(&this->vOpenAngle, 0, 0x800)) { DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgHakaGate_FloorClosed; } } else { - Math_ScaledStepToS(&this->vOpenAngle, 0x3000, 0x800); + Math_RotationStepToS(&this->vOpenAngle, 0x3000, 0x800); } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 667f1f309b3..e0f0ca6db8c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -165,7 +165,7 @@ void BgHakaShip_SetupCrash(BgHakaShip* this, PlayState* play) { this->counter = 40; this->actionFunc = BgHakaShip_CrashShake; } - Math_ScaledStepToS(&this->yOffset, 0, 128); + Math_RotationStepToS(&this->yOffset, 0, 128); } void BgHakaShip_CrashShake(BgHakaShip* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index a91df648c10..3ed57c125b2 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -510,13 +510,13 @@ void BgHakaTrap_FanBlade_ToggleFanGust(BgHakaTrap* this, PlayState* play) { // world.rot.z is the current angular velocity of the fan if (this->timer != 0) { // Fan winds down - if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { + if (Math_RotationStepToS(&this->dyna.actor.world.rot.z, 0, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { this->timer = 40; this->actionFunc = BgHakaTrap_FanBlade_Idle; } } else { // Fan speeds up - if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0x3A00, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { + if (Math_RotationStepToS(&this->dyna.actor.world.rot.z, 0x3A00, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { this->timer = 100; this->actionFunc = BgHakaTrap_FanBlade_FullGust; } diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index f2218398ae0..9237d928528 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -357,7 +357,7 @@ void BgHakaZou_BirdStatueAnim_Topple(BgHakaZou* this, PlayState* play) { this->dyna.actor.world.rot.x += this->dyna.actor.world.rot.x / 8.0f; - if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, -0x4000, this->dyna.actor.world.rot.x)) { + if (Math_RotationStepToS(&this->dyna.actor.shape.rot.x, -0x4000, this->dyna.actor.world.rot.x)) { effectPos.x = this->dyna.actor.world.pos.x; effectPos.y = this->dyna.actor.world.pos.y; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index fd59ec7e573..4e05f636834 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -197,7 +197,7 @@ void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, PlayState* play) { void BgHidanFwbig_Move(BgHidanFwbig* this, PlayState* play) { if (!Player_InCsMode(play)) { - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->direction * 0x6390), 0x20)) { + if (Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->direction * 0x6390), 0x20)) { this->moveState = FWBIG_RESET; this->actionFunc = BgHidanFwbig_Lower; } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 81fe1e598f6..a44c198c996 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -516,7 +516,7 @@ void func_80896ABC(BgJyaCobra* this, PlayState* play) { Math_StepToS(&this->unk_16E, 21, 10); } - if (Math_ScaledStepToS(&this->unk_170, this->unk_16A * 0x2000, this->unk_16E)) { + if (Math_RotationStepToS(&this->unk_170, this->unk_16A * 0x2000, this->unk_16E)) { this->unk_16C = (this->unk_16C + this->unk_16A) & 7; player->stateFlags2 &= ~PLAYER_STATE2_4; this->dyna.unk_150 = 0.0f; diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 652ec8e8e6e..c66e4f522bc 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -114,7 +114,7 @@ void func_80899950(BgJyaKanaami* this, PlayState* play) { s32 quakeIndex; this->unk_168 += 0x20; - if (Math_ScaledStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) { + if (Math_RotationStepToS(&this->dyna.actor.world.rot.x, 0x4000, this->unk_168)) { func_80899A08(this); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_TRAP_BOUND); diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index bbfecc301fb..0c3962895a3 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -437,7 +437,7 @@ void BgPoEvent_BlockReset(BgPoEvent* this, PlayState* play) { this->dyna.unk_150 = 0.0f; } if (Math_StepToF(&this->dyna.actor.world.pos.y, 493.0f, 1.0f) && - Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.world.rot.z - 0x4000, 0x400)) { + Math_RotationStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.world.rot.z - 0x4000, 0x400)) { this->index = (this->index + 1) % 4; this->actionFunc = BgPoEvent_BlockFall; diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 5058440e472..30ab0453ed9 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -194,9 +194,9 @@ void func_808A939C(BgRelayObjects* this, PlayState* play) { SET_EVENTCHKINF(EVENTCHKINF_65); } if (GET_EVENTCHKINF(EVENTCHKINF_65)) { - Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x400, 8); + Math_RotationStepToS(&this->dyna.actor.world.rot.y, 0x400, 8); } else { - Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x80, 8); + Math_RotationStepToS(&this->dyna.actor.world.rot.y, 0x80, 8); } this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y; func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WOOD_GEAR - SFX_FLAG, diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index d3f827b6969..8778d4cade2 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -175,16 +175,16 @@ void BgSpot00Hanebasi_DrawbridgeRiseAndFall(BgSpot00Hanebasi* this, PlayState* p Actor* childsChild; s16 angle = 80; - if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, this->destAngle, 80)) { + if (Math_RotationStepToS(&this->dyna.actor.shape.rot.x, this->destAngle, 80)) { this->actionFunc = BgSpot00Hanebasi_DrawbridgeWait; } if (this->dyna.actor.shape.rot.x >= -0x27D8) { child = (BgSpot00Hanebasi*)this->dyna.actor.child; angle *= 0.4f; - Math_ScaledStepToS(&child->dyna.actor.shape.rot.x, child->destAngle, angle); + Math_RotationStepToS(&child->dyna.actor.shape.rot.x, child->destAngle, angle); childsChild = child->dyna.actor.child; - Math_ScaledStepToS(&childsChild->shape.rot.x, child->destAngle, angle); + Math_RotationStepToS(&childsChild->shape.rot.x, child->destAngle, angle); } if (this->destAngle < 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 25adbc11101..9f55a742a56 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -372,7 +372,7 @@ void BgSpot06Objects_LockSwimToSurface(BgSpot06Objects* this, PlayState* play) { this->dyna.actor.world.pos.y -= 1.3f; BgSpot06Objects_LockSpawnWaterRipples(this, play, 0); - if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, 0, 0x260) != 0) { + if (Math_RotationStepToS(&this->dyna.actor.shape.rot.x, 0, 0x260) != 0) { this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y) * 16.0f); this->dyna.actor.home.pos.z = @@ -398,7 +398,7 @@ void BgSpot06Objects_LockSwimToSurface(BgSpot06Objects* this, PlayState* play) { } else { BgSpot06Objects_LockSpawnBubbles(this, play, 0); - if (Math_ScaledStepToS(&this->dyna.actor.shape.rot.x, -0x4000, 0x30)) { + if (Math_RotationStepToS(&this->dyna.actor.shape.rot.x, -0x4000, 0x30)) { this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.y = -1993.0f; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index f4cb18d3036..06f140cbdd8 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -1340,7 +1340,7 @@ void BossSst_HandDownbeatEnd(BossSst* this, PlayState* play) { BossSst_HandSetupWait(this); } else { Math_SmoothStepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 40.0f, 0.5f, 20.0f, 3.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x800, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x800, 0x100); Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f); Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f); if ((sHead->actionFunc != BossSst_HeadIntro) && ((sHead->timer % 28) == 12)) { @@ -1392,7 +1392,7 @@ void BossSst_HandOffbeatEnd(BossSst* this, PlayState* play) { BossSst_HandSetupWait(this); } else { Math_SmoothStepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 40.0f, 0.5f, 20.0f, 3.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x400, 0xA0); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x400, 0xA0); Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f); Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f); if (sHead->actionFunc == BossSst_HeadWait) { @@ -1455,9 +1455,9 @@ void BossSst_HandRetreat(BossSst* this, PlayState* play) { Animation_MorphToLoop(&this->skelAnime, sHandIdleAnims[this->actor.params], 4.0f); } } else { - inPosition = Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x200); - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0x200); - inPosition &= Math_ScaledStepToS(&this->handYRotMod, 0, 0x800); + inPosition = Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x200); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0x200); + inPosition &= Math_RotationStepToS(&this->handYRotMod, 0, 0x800); Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); if ((Math_SmoothStepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 250.0f, 0.5f, 70.0f, 5.0f) < 1.0f) && inPosition && (diff < 10.0f)) { @@ -1490,7 +1490,7 @@ void BossSst_HandReadySlam(BossSst* this, PlayState* play) { (this->actor.xzDistToPlayer < 140.0f)) { this->timer = 20; } - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1000, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x1000, 0x100); Math_ApproachF(&this->actor.world.pos.x, player->actor.world.pos.x, 0.5f, 40.0f); Math_ApproachF(&this->actor.world.pos.z, player->actor.world.pos.z, 0.5f, 40.0f); Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_SHADEST_HAND_FLY - SFX_FLAG); @@ -1510,8 +1510,8 @@ void BossSst_HandSetupSlam(BossSst* this) { void BossSst_HandSlam(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_StepToS(&this->handZPosMod, -0xDAC, 0x1F4); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x1000); - Math_ScaledStepToS(&this->handYRotMod, 0, 0x1000); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x1000); + Math_RotationStepToS(&this->handYRotMod, 0, 0x1000); if (this->timer != 0) { if (this->timer != 0) { this->timer--; @@ -1551,7 +1551,7 @@ void BossSst_HandSlam(BossSst* this, PlayState* play) { Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); } - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x200); } } @@ -1569,8 +1569,8 @@ void BossSst_HandReadySweep(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); inPosition = Math_StepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 50.0f, 4.0f); - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x200); - inPosition &= Math_ScaledStepToS(&this->actor.world.rot.y, this->targetYaw, 0x400); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x200); + inPosition &= Math_RotationStepToS(&this->actor.world.rot.y, this->targetYaw, 0x400); inPosition &= (Math_SmoothStepToF(&this->radius, sHead->actor.xzDistToPlayer, 0.5f, 60.0f, 1.0f) < 10.0f); this->actor.world.pos.x = (Math_SinS(this->actor.world.rot.y) * this->radius) + sHead->actor.world.pos.x; @@ -1636,7 +1636,7 @@ void BossSst_HandSetupReadyPunch(BossSst* this) { } void BossSst_HandReadyPunch(BossSst* this, PlayState* play) { - s32 inPosition = Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x400); + s32 inPosition = Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x400); if (SkelAnime_Update(&this->skelAnime) && inPosition) { BossSst_HandSetupPunch(this); @@ -1655,7 +1655,7 @@ void BossSst_HandSetupPunch(BossSst* this) { void BossSst_HandPunch(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_StepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 80.0f, 20.0f); - if (Math_ScaledStepToS(&this->actor.shape.rot.z, this->targetRoll, 0x400)) { + if (Math_RotationStepToS(&this->actor.shape.rot.z, this->targetRoll, 0x400)) { this->targetRoll *= -1; } @@ -1705,10 +1705,10 @@ void BossSst_HandReadyClap(BossSst* this, PlayState* play) { } } else if (!this->ready) { this->ready = SkelAnime_Update(&this->skelAnime); - this->ready &= Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x600); - this->ready &= Math_ScaledStepToS(&this->actor.shape.rot.z, this->targetRoll, 0x600); - this->ready &= Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x200); - this->ready &= Math_ScaledStepToS(&this->actor.world.rot.y, this->targetYaw, 0x400); + this->ready &= Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x600); + this->ready &= Math_RotationStepToS(&this->actor.shape.rot.z, this->targetRoll, 0x600); + this->ready &= Math_RotationStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x200); + this->ready &= Math_RotationStepToS(&this->actor.world.rot.y, this->targetYaw, 0x400); this->ready &= Math_SmoothStepToF(&this->radius, sHead->actor.xzDistToPlayer, 0.5f, 50.0f, 1.0f) < 10.0f; this->ready &= Math_SmoothStepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 95.0f, 0.5f, 30.0f, 1.0f) < 1.0f; @@ -1766,7 +1766,7 @@ void BossSst_HandClap(BossSst* this, PlayState* play) { this->handAngSpeed += 0x40; this->handAngSpeed = CLAMP_MAX(this->handAngSpeed, this->handMaxSpeed); - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, this->handAngSpeed)) { + if (Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, this->handAngSpeed)) { if (this->actor.params == BONGO_LEFT_HAND) { Actor_PlaySfx(&this->actor, NA_SE_EN_SHADEST_CLAP); } @@ -1795,8 +1795,8 @@ void BossSst_HandSetupEndClap(BossSst* this) { void BossSst_HandEndClap(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x200); - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x100)) { + Math_RotationStepToS(&this->actor.shape.rot.z, 0, 0x200); + if (Math_RotationStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x100)) { BossSst_HandSetupRetreat(this); } this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * this->radius) + sHead->actor.world.pos.x; @@ -1816,7 +1816,7 @@ void BossSst_HandReadyGrab(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); inPosition = Math_SmoothStepToS(&this->actor.shape.rot.z, this->targetRoll, 4, 0x800, 0x100) == 0; - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->targetYaw, 0xA00); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->targetYaw, 0xA00); Math_ApproachF(&this->actor.world.pos.y, ROOM_CENTER_Y + 95.0f, 0.5f, 20.0f); if (inPosition) { BossSst_HandSetupGrab(this); @@ -1941,7 +1941,7 @@ void BossSst_HandSwing(BossSst* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 offXZ; - if (Math_ScaledStepToS(&this->actor.shape.rot.x, this->amplitude, this->timer * 0xE4 + 0x1C8)) { + if (Math_RotationStepToS(&this->actor.shape.rot.x, this->amplitude, this->timer * 0xE4 + 0x1C8)) { if (this->amplitude != 0) { this->amplitude = 0; if (this->timer == 4) { @@ -1966,7 +1966,7 @@ void BossSst_HandSwing(BossSst* this, PlayState* play) { if (this->timer != 4) { this->actor.shape.rot.z = (this->actor.shape.rot.x + 0x4000) * this->vParity; } else { - Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.z, 0, 0x800); } if (player->stateFlags2 & PLAYER_STATE2_7) { @@ -1975,8 +1975,8 @@ void BossSst_HandSwing(BossSst* this, PlayState* play) { player->actor.shape.rot.x = this->actor.shape.rot.x; player->actor.shape.rot.z = (this->vParity * -0x4000) + this->actor.shape.rot.z; } else { - Math_ScaledStepToS(&player->actor.shape.rot.x, 0, 0x600); - Math_ScaledStepToS(&player->actor.shape.rot.z, 0, 0x600); + Math_RotationStepToS(&player->actor.shape.rot.x, 0, 0x600); + Math_RotationStepToS(&player->actor.shape.rot.z, 0, 0x600); player->actor.world.pos.x += 20.0f * Math_SinS(this->actor.shape.rot.y); player->actor.world.pos.z += 20.0f * Math_CosS(this->actor.shape.rot.y); } @@ -2042,11 +2042,11 @@ void BossSst_HandReadyShake(BossSst* this, PlayState* play) { diff = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.5f, 25.0f, 1.0f); diff += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 0.5f, 25.0f, 1.0f); diff += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 200.0f, 0.2f, 30.0f, 1.0f); - inPosition = Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x400); - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x1000); - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x800); + inPosition = Math_RotationStepToS(&this->actor.shape.rot.x, 0x4000, 0x400); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.z, 0, 0x1000); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x800); inPosition &= Math_StepToS(&this->handZPosMod, -0x5DC, 0x1F4); - inPosition &= Math_ScaledStepToS(&this->handYRotMod, this->vParity * -0x2000, 0x800); + inPosition &= Math_RotationStepToS(&this->handYRotMod, this->vParity * -0x2000, 0x800); this->actor.colorFilterTimer = 200; if ((diff < 30.0f) && inPosition) { BossSst_HandSetupShake(this); @@ -2095,11 +2095,11 @@ void BossSst_HandSetupReadyCharge(BossSst* this) { void BossSst_HandReadyCharge(BossSst* this, PlayState* play) { if (!this->ready) { this->ready = SkelAnime_Update(&this->skelAnime); - this->ready &= Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x800); + this->ready &= Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x800); this->ready &= - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->vParity * 0x1000), 0x800); - this->ready &= Math_ScaledStepToS(&this->handYRotMod, 0, 0x800); - this->ready &= Math_ScaledStepToS(&this->actor.shape.rot.z, this->vParity * 0x2800, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->vParity * 0x1000), 0x800); + this->ready &= Math_RotationStepToS(&this->handYRotMod, 0, 0x800); + this->ready &= Math_RotationStepToS(&this->actor.shape.rot.z, this->vParity * 0x2800, 0x800); this->ready &= Math_StepToS(&this->handZPosMod, -0xDAC, 0x1F4); if (this->ready) { this->actor.colorFilterTimer = 0; @@ -2134,11 +2134,11 @@ void BossSst_HandStunned(BossSst* this, PlayState* play) { Math_ApproachF(&this->actor.world.pos.x, (Math_SinS(sHead->actor.shape.rot.y) * 200.0f) + this->actor.home.pos.x, 0.5f, 25.0f); if (!this->ready) { - Math_ScaledStepToS(&this->handYRotMod, 0, 0x800); + Math_RotationStepToS(&this->handYRotMod, 0, 0x800); Math_StepToS(&this->handZPosMod, -0xDAC, 0x1F4); - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.home.rot.x, 0x800); - Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0x800); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, this->actor.home.rot.x, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x800); if (sHead->actionFunc == BossSst_HeadVulnerable) { this->ready = true; Animation_MorphToPlayOnce(&this->skelAnime, sHandDamagePoses[this->actor.params], 10.0f); @@ -2203,7 +2203,7 @@ void BossSst_HandThrash(BossSst* this, PlayState* play) { 0.5f, 25.0f); Math_ApproachF(&this->actor.world.pos.x, (Math_SinS(sHead->actor.shape.rot.y) * 200.0f) + this->actor.home.pos.x, 0.5f, 25.0f); - if (Math_ScaledStepToS(&this->actor.shape.rot.x, this->amplitude, this->handAngSpeed)) { + if (Math_RotationStepToS(&this->actor.shape.rot.x, this->amplitude, this->handAngSpeed)) { if (this->amplitude != 0) { this->amplitude = 0; Animation_MorphToPlayOnce(&this->skelAnime, sHandFlatPoses[this->actor.params], 5.0f); @@ -2233,7 +2233,7 @@ void BossSst_HandSetupDarken(BossSst* this) { void BossSst_HandDarken(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x800, this->handAngSpeed); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x800, this->handAngSpeed); Math_StepToF(&this->actor.world.pos.y, ROOM_CENTER_Y + 90.0f, 5.0f); if (sHead->actionFunc == BossSst_HeadFall) { BossSst_HandSetupFall(this); @@ -2247,7 +2247,7 @@ void BossSst_HandSetupFall(BossSst* this) { void BossSst_HandFall(BossSst* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x400); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x400); this->actor.world.pos.y = sHead->actor.world.pos.y + 230.0f; if (sHead->actionFunc == BossSst_HeadMelt) { BossSst_HandSetupMelt(this); @@ -2378,10 +2378,10 @@ void BossSst_HandSetupReadyBreakIce(BossSst* this) { void BossSst_HandReadyBreakIce(BossSst* this, PlayState* play) { s32 inPosition; - inPosition = Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x400); - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1000, 0x400); - inPosition &= Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x800); - inPosition &= Math_ScaledStepToS(&this->handYRotMod, 0, 0x400); + inPosition = Math_RotationStepToS(&this->actor.shape.rot.y, this->targetYaw, 0x400); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.x, 0x1000, 0x400); + inPosition &= Math_RotationStepToS(&this->actor.shape.rot.z, 0, 0x800); + inPosition &= Math_RotationStepToS(&this->handYRotMod, 0, 0x400); inPosition &= Math_StepToF(&this->actor.world.pos.y, OTHER_HAND(this)->center.y + 200.0f, 50.0f); inPosition &= Math_StepToF(&this->radius, 400.0f, 60.0f); this->actor.world.pos.x = OTHER_HAND(this)->center.x - (Math_SinS(this->targetYaw) * this->radius); diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index ed7821156e2..8cc6fd4d76f 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1998,8 +1998,8 @@ void BossVa_ZapperAttack(BossVa* this, PlayState* play) { sp54 = -sp54; } - Math_ScaledStepToS(&sp6C, sp6E, sp5A * sp50); - Math_ScaledStepToS(&sp56, sp58, sp54 * sp50); + Math_RotationStepToS(&sp6C, sp6E, sp5A * sp50); + Math_RotationStepToS(&sp56, sp58, sp54 * sp50); sp68 = -Math_SinS(sp56) * 12.0f; sp5C = Math_CosS(sp56) * 12.0f; diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index b67018dae3d..220943480b8 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -289,7 +289,7 @@ void func_809BD2E4(EnBigokuta* this) { Actor* parent = this->actor.parent; if (parent != NULL) { - Math_ScaledStepToS(&parent->world.rot.y, this->unk_19A, 0x10); + Math_RotationStepToS(&parent->world.rot.y, this->unk_19A, 0x10); } } @@ -466,7 +466,7 @@ void func_809BD8DC(EnBigokuta* this, PlayState* play) { } void func_809BDAE8(EnBigokuta* this, PlayState* play) { - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + 0x4000, 0x400)) { + if (Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + 0x4000, 0x400)) { if (this->unk_196 != 0) { this->unk_196--; } @@ -584,7 +584,7 @@ void func_809BDFC8(EnBigokuta* this, PlayState* play) { if (this->unk_196 == 20) { Actor_PlaySfx(&this->actor, NA_SE_EN_DAIOCTA_VOICE); } - if ((this->unk_196 == 0) && Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.x, 0x800)) { + if ((this->unk_196 == 0) && Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.world.rot.x, 0x800)) { this->unk_194 = -this->unk_194; func_809BD3F8(this); } diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 8c59981d488..77c219cf8f6 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -451,7 +451,7 @@ void EnBili_SetNewHomeHeight(EnBili* this, PlayState* play) { this->timer--; } - Math_ScaledStepToS(&this->actor.world.rot.y, (s16)(this->actor.yawTowardsPlayer + 0x8000), 910); + Math_RotationStepToS(&this->actor.world.rot.y, (s16)(this->actor.yawTowardsPlayer + 0x8000), 910); EnBili_UpdateFloating(this); if (this->timer == 0) { diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index c2ab0160da7..58b2d5cf958 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -353,9 +353,9 @@ void EnBomChu_Move(EnBomChu* this, PlayState* play) { } } - Math_ScaledStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x, 0x800); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x800); - Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 0x800); Actor_PlaySfx_Flagged2(&this->actor, NA_SE_IT_BOMBCHU_MOVE - SFX_FLAG); } diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 18d35a395db..a284e4b8917 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -152,8 +152,8 @@ void EnBoom_Fly(EnBoom* this, PlayState* play) { // the moveTo pointer is nulled and it flies off in a seemingly random direction. this->moveTo = NULL; } else { - Math_ScaledStepToS(&this->actor.world.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); - Math_ScaledStepToS(&this->actor.world.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); + Math_RotationStepToS(&this->actor.world.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); + Math_RotationStepToS(&this->actor.world.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); } } diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 5d3354820e2..5f19ec8b1b0 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -219,7 +219,7 @@ void EnButte_Turn(EnButte* this) { s16 target = this->actor.world.rot.y + 0x8000; s16 diff = target - this->actor.shape.rot.y; - Math_ScaledStepToS(&this->actor.shape.rot.y, target, ABS(diff) >> 3); + Math_RotationStepToS(&this->actor.shape.rot.y, target, ABS(diff) >> 3); this->actor.shape.rot.x = (s16)(sinf(this->unk_260) * 600.0f) - 0x2320; } @@ -257,17 +257,17 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) { if ((this->flightParamsIdx != 0) && ((distSqFromHome > maxDistSqFromHome) || (this->timer < 4))) { yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); - if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, flightParams->rotYStep) == 0) { + if (Math_RotationStepToS(&this->actor.world.rot.y, yaw, flightParams->rotYStep) == 0) { minAnimSpeed = 0.5f; } } else if ((this->unk_257 == 0) && (this->actor.child != NULL) && (this->actor.child != &this->actor)) { yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos); - if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { + if (Math_RotationStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { minAnimSpeed = 0.3f; } } else if (this->unk_257 == 1) { yaw = this->actor.yawTowardsPlayer + 0x8000 + (s16)((Rand_ZeroOne() - 0.5f) * 0x6000); - if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { + if (Math_RotationStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { minAnimSpeed = 0.4f; } } else { @@ -328,7 +328,7 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) { MELEE_WEAPON_INFO_TIP(&player->meleeWeaponInfo[0])->z + Math_CosS(player->actor.shape.rot.y) * 10.0f; yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410); - if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000) != 0) { + if (Math_RotationStepToS(&this->actor.world.rot.y, yaw, 2000) != 0) { if (play->gameplayFrames % 2) { this->actor.world.rot.y += (s16)(sinf(this->unk_25C) * 60.0f); } diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 2b185e6362a..a71b30751cb 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -284,7 +284,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) { } if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x100, 0x400); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x100, 0x400); } if (this->timer != 0) { @@ -345,7 +345,7 @@ void EnCrow_Damaged(EnCrow* this, PlayState* play) { if (!(this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW)) { if (this->actor.colorFilterParams & 0x4000) { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x4000, 0x200); this->actor.shape.rot.z += 0x1780; } if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index a133dda66ba..8ebfa9a0abb 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -506,28 +506,28 @@ void EnDekubaba_Grow(EnDekubaba* this, PlayState* play) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = this->size * 0.01f * (0.5f + (15 - this->timer) * 0.5f / 15.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1800, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x1800, 0x800); headDistVertical = sinf(CLAMP_MAX((15 - this->timer) * (1.0f / 15), 0.7f) * M_PI) * 32.0f + 14.0f; if (this->actor.shape.rot.x < -0x38E3) { headDistHorizontal = 0.0f; } else if (this->actor.shape.rot.x < -0x238E) { - Math_ScaledStepToS(&this->stemSectionAngle[0], -0x5555, 0x38E); + Math_RotationStepToS(&this->stemSectionAngle[0], -0x5555, 0x38E); headDistHorizontal = Math_CosS(this->stemSectionAngle[0]) * 20.0f; } else if (this->actor.shape.rot.x < -0xE38) { - Math_ScaledStepToS(&this->stemSectionAngle[0], -0xAAA, 0x38E); - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x5555, 0x38E); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5555, 0x222); + Math_RotationStepToS(&this->stemSectionAngle[0], -0xAAA, 0x38E); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x5555, 0x38E); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x5555, 0x222); headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + (headDistVertical - 20.0f * (-Math_SinS(this->stemSectionAngle[0]) - Math_SinS(this->stemSectionAngle[1]))) * Math_CosS(this->stemSectionAngle[2]) / -Math_SinS(this->stemSectionAngle[2]); } else { - Math_ScaledStepToS(&this->stemSectionAngle[0], -0xAAA, 0x38E); - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x31C7, 0x222); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5555, 0x222); + Math_RotationStepToS(&this->stemSectionAngle[0], -0xAAA, 0x38E); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x31C7, 0x222); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x5555, 0x222); headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + (headDistVertical - @@ -573,28 +573,28 @@ void EnDekubaba_Retract(EnDekubaba* this, PlayState* play) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = this->size * 0.01f * (0.5f + this->timer * (1.0f / 30)); - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x300); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x4000, 0x300); headDistVertical = (sinf(CLAMP_MAX(this->timer * 0.033f, 0.7f) * M_PI) * 32.0f) + 14.0f; if (this->actor.shape.rot.x < -0x38E3) { headDistHorizontal = 0.0f; } else if (this->actor.shape.rot.x < -0x238E) { - Math_ScaledStepToS(&this->stemSectionAngle[0], -0x4000, 0x555); + Math_RotationStepToS(&this->stemSectionAngle[0], -0x4000, 0x555); headDistHorizontal = Math_CosS(this->stemSectionAngle[0]) * 20.0f; } else if (this->actor.shape.rot.x < -0xE38) { - Math_ScaledStepToS(&this->stemSectionAngle[0], -0x5555, 0x555); - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x4000, 0x555); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x4000, 0x333); + Math_RotationStepToS(&this->stemSectionAngle[0], -0x5555, 0x555); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x4000, 0x555); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x4000, 0x333); headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + (headDistVertical - 20.0f * (-Math_SinS(this->stemSectionAngle[0]) - Math_SinS(this->stemSectionAngle[1]))) * Math_CosS(this->stemSectionAngle[2]) / -Math_SinS(this->stemSectionAngle[2]); } else { - Math_ScaledStepToS(&this->stemSectionAngle[0], -0x5555, 0x555); - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x5555, 0x333); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x4000, 0x333); + Math_RotationStepToS(&this->stemSectionAngle[0], -0x5555, 0x555); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x5555, 0x333); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x4000, 0x333); headDistHorizontal = 20.0f * (Math_CosS(this->stemSectionAngle[0]) + Math_CosS(this->stemSectionAngle[1])) + (headDistVertical - @@ -695,14 +695,14 @@ void EnDekubaba_Lunge(EnDekubaba* this, PlayState* play) { } } - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x222); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x222); curFrame10 = this->skelAnime.curFrame * 10.0f; allStepsDone = true; - allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[0], -0xE38, curFrame10 + 0x38E); - allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[1], -0xE38, curFrame10 + 0x71C); - allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[2], -0xE38, curFrame10 + 0xE38); + allStepsDone &= Math_RotationStepToS(&this->stemSectionAngle[0], -0xE38, curFrame10 + 0x38E); + allStepsDone &= Math_RotationStepToS(&this->stemSectionAngle[1], -0xE38, curFrame10 + 0x71C); + allStepsDone &= Math_RotationStepToS(&this->stemSectionAngle[2], -0xE38, curFrame10 + 0xE38); if (allStepsDone) { Animation_PlayLoopSetSpeed(&this->skelAnime, &gDekuBabaFastChompAnim, 4.0f); @@ -745,9 +745,9 @@ void EnDekubaba_PrepareLunge(EnDekubaba* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.x, 0x1800, 2, 0xE38, 0x71C); Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos), 2, 0xE38); - Math_ScaledStepToS(&this->stemSectionAngle[0], 0xAAA, 0x444); - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x4718, 0x888); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x6AA4, 0x888); + Math_RotationStepToS(&this->stemSectionAngle[0], 0xAAA, 0x444); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x4718, 0x888); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x6AA4, 0x888); if (this->timer == 0) { EnDekubaba_SetupLunge(this); @@ -765,10 +765,10 @@ void EnDekubaba_PullBack(EnDekubaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->timer == 0) { - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x93E, 0x38E); - Math_ScaledStepToS(&this->stemSectionAngle[0], -0x888, 0x16C); - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x888, 0x16C); - if (Math_ScaledStepToS(&this->stemSectionAngle[2], -0x888, 0x16C)) { + Math_RotationStepToS(&this->actor.shape.rot.x, -0x93E, 0x38E); + Math_RotationStepToS(&this->stemSectionAngle[0], -0x888, 0x16C); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x888, 0x16C); + if (Math_RotationStepToS(&this->stemSectionAngle[2], -0x888, 0x16C)) { xIncr = Math_SinS(this->actor.shape.rot.y) * 30.0f * this->size; zIncr = Math_CosS(this->actor.shape.rot.y) * 30.0f * this->size; dustPos = this->actor.home.pos; @@ -782,40 +782,40 @@ void EnDekubaba_PullBack(EnDekubaba* this, PlayState* play) { this->timer = 1; } } else if (this->timer == 11) { - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x93E, 0x200); - Math_ScaledStepToS(&this->stemSectionAngle[0], -0xAAA, 0x200); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x93E, 0x200); + Math_RotationStepToS(&this->stemSectionAngle[0], -0xAAA, 0x200); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x5C71, 0x200); - if (Math_ScaledStepToS(&this->stemSectionAngle[1], 0x238C, 0x200)) { + if (Math_RotationStepToS(&this->stemSectionAngle[1], 0x238C, 0x200)) { this->timer = 12; } } else if (this->timer == 18) { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x2AA8, 0xAAA); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x2AA8, 0xAAA); - if (Math_ScaledStepToS(&this->stemSectionAngle[0], 0x1554, 0x5B0)) { + if (Math_RotationStepToS(&this->stemSectionAngle[0], 0x1554, 0x5B0)) { this->timer = 25; } - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x38E3, 0xAAA); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x2D8); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x38E3, 0xAAA); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x5C71, 0x2D8); } else if (this->timer == 25) { - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x5550, 0xAAA); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x5550, 0xAAA); - if (Math_ScaledStepToS(&this->stemSectionAngle[0], -0x6388, 0x93E)) { + if (Math_RotationStepToS(&this->stemSectionAngle[0], -0x6388, 0x93E)) { this->timer = 26; } - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x3FFC, 0x4FA); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x238C, 0x444); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x3FFC, 0x4FA); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x238C, 0x444); } else if (this->timer == 26) { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1800, 0x93E); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x1800, 0x93E); - if (Math_ScaledStepToS(&this->stemSectionAngle[0], -0x1555, 0x71C)) { + if (Math_RotationStepToS(&this->stemSectionAngle[0], -0x1555, 0x71C)) { this->timer = 27; } - Math_ScaledStepToS(&this->stemSectionAngle[1], -0x38E3, 0x2D8); - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x5B0); + Math_RotationStepToS(&this->stemSectionAngle[1], -0x38E3, 0x2D8); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x5C71, 0x5B0); } else if (this->timer >= 27) { this->timer++; @@ -834,7 +834,7 @@ void EnDekubaba_PullBack(EnDekubaba* this, PlayState* play) { } if (this->timer >= 12) { - Math_ScaledStepToS(&this->stemSectionAngle[2], -0x5C71, 0x88); + Math_RotationStepToS(&this->stemSectionAngle[2], -0x5C71, 0x88); } } @@ -877,10 +877,10 @@ void EnDekubaba_Hit(EnDekubaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); allStepsDone = true; - allStepsDone &= Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0xE38); - allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[0], -0x4000, 0xE38); - allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[1], -0x4000, 0xE38); - allStepsDone &= Math_ScaledStepToS(&this->stemSectionAngle[2], -0x4000, 0xE38); + allStepsDone &= Math_RotationStepToS(&this->actor.shape.rot.x, -0x4000, 0xE38); + allStepsDone &= Math_RotationStepToS(&this->stemSectionAngle[0], -0x4000, 0xE38); + allStepsDone &= Math_RotationStepToS(&this->stemSectionAngle[1], -0x4000, 0xE38); + allStepsDone &= Math_RotationStepToS(&this->stemSectionAngle[2], -0x4000, 0xE38); if (allStepsDone) { if (this->actor.colChkInfo.health == 0) { @@ -927,11 +927,11 @@ void EnDekubaba_Sway(EnDekubaba* this, PlayState* play) { s16 angleToVertical; SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, this->stemSectionAngle[0], 0x71C); - Math_ScaledStepToS(&this->stemSectionAngle[0], this->stemSectionAngle[1], 0x71C); - Math_ScaledStepToS(&this->stemSectionAngle[1], this->stemSectionAngle[2], 0x71C); + Math_RotationStepToS(&this->actor.shape.rot.x, this->stemSectionAngle[0], 0x71C); + Math_RotationStepToS(&this->stemSectionAngle[0], this->stemSectionAngle[1], 0x71C); + Math_RotationStepToS(&this->stemSectionAngle[1], this->stemSectionAngle[2], 0x71C); - if (Math_ScaledStepToS(&this->stemSectionAngle[2], this->targetSwayAngle, 0x71C)) { + if (Math_RotationStepToS(&this->stemSectionAngle[2], this->targetSwayAngle, 0x71C)) { this->targetSwayAngle = -0x4000 - (this->targetSwayAngle + 0x4000) * 0.8f; } angleToVertical = this->targetSwayAngle + 0x4000; @@ -958,9 +958,9 @@ void EnDekubaba_PrunedSomersault(EnDekubaba* this, PlayState* play) { Math_StepToF(&this->actor.speed, 0.0f, this->size * 0.1f); if (this->timer == 0) { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); - Math_ScaledStepToS(&this->stemSectionAngle[0], 0x4800, 0x71C); - Math_ScaledStepToS(&this->stemSectionAngle[1], 0x4800, 0x71C); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); + Math_RotationStepToS(&this->stemSectionAngle[0], 0x4800, 0x71C); + Math_RotationStepToS(&this->stemSectionAngle[1], 0x4800, 0x71C); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, this->size * 3.0f, 0, this->size * 12.0f, this->size * 5.0f, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index ed44df927bb..0f1c050afa6 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -299,13 +299,13 @@ void EnDoor_AjarWait(EnDoor* this, PlayState* play) { void EnDoor_AjarOpen(EnDoor* this, PlayState* play) { if (this->actor.xzDistToPlayer < DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarClose; - } else if (Math_ScaledStepToS(&this->actor.world.rot.y, -0x1800, 0x100)) { + } else if (Math_RotationStepToS(&this->actor.world.rot.y, -0x1800, 0x100)) { this->actionFunc = EnDoor_AjarWait; } } void EnDoor_AjarClose(EnDoor* this, PlayState* play) { - if (Math_ScaledStepToS(&this->actor.world.rot.y, 0, 0x700)) { + if (Math_RotationStepToS(&this->actor.world.rot.y, 0, 0x700)) { this->actionFunc = EnDoor_Idle; } } diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index b1a7d1f87ad..835716280eb 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -378,7 +378,7 @@ void EnEiyer_WanderUnderground(EnEiyer* this, PlayState* play) { this->actor.world.rot.y + (Rand_ZeroOne() < 0.5f ? -1 : 1) * (Rand_ZeroOne() * 0x2000 + 0x2000); } - Math_ScaledStepToS(&this->actor.world.rot.y, this->targetYaw, 0xB6); + Math_RotationStepToS(&this->actor.world.rot.y, this->targetYaw, 0xB6); EnEiyer_CheckPlayerCollision(this, play); } @@ -450,7 +450,7 @@ void EnEiyer_Glide(EnEiyer* this, PlayState* play) { this->targetYaw = this->actor.wallYaw; } - if (Math_ScaledStepToS(&this->actor.world.rot.y, this->targetYaw, 0xB6)) { + if (Math_RotationStepToS(&this->actor.world.rot.y, this->targetYaw, 0xB6)) { if (this->timer != 0 || Rand_ZeroOne() > 0.05f) { this->actor.world.rot.y += 0x100; } else { @@ -477,7 +477,7 @@ void EnEiyer_StartAttack(EnEiyer* this, PlayState* play) { focus.y = player->actor.world.pos.y + 20.0f; focus.z = player->actor.world.pos.z; - if (Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &focus), 0x1000)) { + if (Math_RotationStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &focus), 0x1000)) { EnEiyer_SetupDiveAttack(this, play); } } else { @@ -507,7 +507,7 @@ void EnEiyer_DiveAttack(EnEiyer* this, PlayState* play) { void EnEiyer_Land(EnEiyer* this, PlayState* play) { SkelAnime_Update(&this->skelanime); - Math_ScaledStepToS(&this->actor.world.rot.x, -0x4000, 0x450); + Math_RotationStepToS(&this->actor.world.rot.x, -0x4000, 0x450); Math_StepToF(&this->actor.speed, 7.0f, 1.0f); if (this->timer == -1) { @@ -548,8 +548,8 @@ void EnEiyer_Hurt(EnEiyer* this, PlayState* play) { this->targetYaw = this->actor.yawTowardsPlayer + 0x8000; } - Math_ScaledStepToS(&this->actor.world.rot.y, this->targetYaw, 0x38E); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x200); + Math_RotationStepToS(&this->actor.world.rot.y, this->targetYaw, 0x38E); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x200); this->actor.shape.rot.z = sinf(this->timer * (M_PI / 5)) * 5120.0f; if (this->timer == 0) { @@ -565,9 +565,9 @@ void EnEiyer_Die(EnEiyer* this, PlayState* play) { SkelAnime_Update(&this->skelanime); if (this->actor.speed > 0.0f) { - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x400); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x4000, 0x400); } else { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x400); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x4000, 0x400); } this->actor.shape.rot.z += 0x1000; @@ -599,7 +599,7 @@ void EnEiyer_Stunned(EnEiyer* this, PlayState* play) { this->timer--; } - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x200); SkelAnime_Update(&this->skelanime); if (Animation_OnFrame(&this->skelanime, 0.0f)) { diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 93ca3bc91bf..42adc734990 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -219,7 +219,7 @@ void EnFirefly_Destroy(Actor* thisx, PlayState* play) { void EnFirefly_SetupFlyIdle(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); this->actor.speed = (Rand_ZeroOne() * 1.5f) + 1.5f; - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); + Math_RotationStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); this->targetPitch = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554; this->skelAnime.playSpeed = 1.0f; this->actionFunc = EnFirefly_FlyIdle; @@ -331,9 +331,9 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) { this->actor.speed *= distFromHome; } - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + Math_RotationStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, + Math_RotationStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100); return 1; } @@ -371,9 +371,9 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) { EnFirefly_Ignite(this); return 1; } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &closestTorch->actor), + Math_RotationStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &closestTorch->actor), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &flamePos) + 0x1554, + Math_RotationStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &flamePos) + 0x1554, 0x100); return 1; } @@ -396,7 +396,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { if (skelanimeUpdated) { rand = Rand_ZeroOne(); if (rand < 0.5f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, + Math_RotationStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); } else if (rand < 0.8f) { this->actor.shape.rot.y += Rand_CenteredFloat(1536.0f); @@ -421,7 +421,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) { this->targetPitch = 0x2154; } } - Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); @@ -442,7 +442,7 @@ void EnFirefly_Fall(EnFirefly* this, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_ATTACHED_TO_ARROW) { this->actor.colorFilterTimer = 40; } else { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x6800, 0x200); this->actor.shape.rot.y -= 0x300; if (this->timer != 0) { this->timer--; @@ -478,7 +478,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { Math_StepToF(&this->actor.speed, 4.0f, 0.5f); if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } else if (Actor_IsFacingPlayer(&this->actor, 0x2800)) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { this->skelAnime.playSpeed = 0.0f; @@ -503,7 +503,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { } else { this->targetPitch = 0x954; } - Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } if ((this->timer == 0) || (Player_GetMask(play) == PLAYER_MASK_SKULL)) { EnFirefly_SetupFlyAway(this); @@ -513,7 +513,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) { // Knockback after hitting player void EnFirefly_Rebound(EnFirefly* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x100); Math_StepToF(&this->actor.velocity.y, 0.0f, 0.4f); if (Math_StepToF(&this->actor.speed, 0.0f, 0.15f)) { if (this->timer != 0) { @@ -547,16 +547,16 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + Math_RotationStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); } - Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } void EnFirefly_Stunned(EnFirefly* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); Math_StepToF(&this->actor.speed, 0.0f, 0.5f); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1554, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x1554, 0x100); if (this->timer != 0) { this->timer--; } @@ -586,7 +586,7 @@ void EnFirefly_FrozenFall(EnFirefly* this, PlayState* play) { // When perching, sit on collision and flap at random intervals void EnFirefly_Perch(EnFirefly* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x100); if (this->timer != 0) { SkelAnime_Update(&this->skelAnime); @@ -613,14 +613,14 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, PlayState* play) { } if (this->timer < 40) { - Math_ScaledStepToS(&this->actor.shape.rot.x, -0xAAC, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.x, -0xAAC, 0x100); } else { preyPos.x = player->actor.world.pos.x; preyPos.y = player->actor.world.pos.y + 20.0f; preyPos.z = player->actor.world.pos.z; - Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, + Math_RotationStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, 0x100); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x300); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x300); } if (this->timer == 0) { diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index f207e8a6124..18701ff2664 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -576,11 +576,11 @@ void EnFish_Unique_SwimIdle(EnFish* this, PlayState* play) { extraPlaySpeed = 0.0f; if ((EnFish_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(15.0f))) { - if (!Math_ScaledStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos), + if (!Math_RotationStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos), 200)) { extraPlaySpeed = 0.5f; } - } else if ((this->timer < 4) && !Math_ScaledStepToS(&this->actor.world.rot.y, frames * 0x80, 100)) { + } else if ((this->timer < 4) && !Math_RotationStepToS(&this->actor.world.rot.y, frames * 0x80, 100)) { extraPlaySpeed = 0.5f; } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 7737e17bba2..9aaefd4cf6c 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -605,7 +605,7 @@ void EnFloormas_Charge(EnFloormas* this, PlayState* play) { } Math_StepToF(&this->actor.speed, 15.0f, SQ(this->actor.speed) * (1.0f / 3.0f)); - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1680, 0x140); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x1680, 0x140); distFromGround = this->actor.world.pos.y - this->actor.floorHeight; if (distFromGround < 10.0f) { @@ -669,7 +669,7 @@ void EnFloormas_Land(EnFloormas* this, PlayState* play) { } } - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x140); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x140); Math_StepToS(&this->zOffset, -1600, 100); } @@ -702,7 +702,7 @@ void EnFloormas_SmallWalk(EnFloormas* this, PlayState* play) { this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); } else if (this->actor.xzDistToPlayer < 120.0f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x38E); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x38E); } } @@ -731,7 +731,7 @@ void EnFloormas_SmallDecideAction(EnFloormas* this, PlayState* play) { return; } - Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primaryFloormas), 0x38E); + Math_RotationStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primaryFloormas), 0x38E); if (Actor_WorldDistXZToActor(&this->actor, primaryFloormas) < 80.0f) { EnFloormas_SetupSmallFollowerJumpAtLeader(this); } diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 14de43c857a..34012a0cb4a 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -424,7 +424,7 @@ void EnHintnuts_Leave(EnHintnuts* this, PlayState* play) { temp_a1 = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - (temp_a1 >> 1) + 0x8000; } } - Math_ScaledStepToS(&this->actor.shape.rot.y, temp_a1, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.y, temp_a1, 0x800); this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->animFlagAndTimer == 0) || (this->actor.projectedPos.z < 0.0f)) { Message_CloseTextbox(play); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 3c6ebe9d03e..e53606321ce 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -425,7 +425,7 @@ void EnHonotrap_SetupFlameChase(EnHonotrap* this) { void EnHonotrap_FlameChase(EnHonotrap* this, PlayState* play) { s32 pad; - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x300); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x300); Math_StepToF(&this->actor.speed, 3.0f, 0.1f); this->actor.gravity = (-this->actor.yDistToPlayer < 10.0f) ? 0.08f : -0.08f; Actor_UpdateVelocityXZGravity(&this->actor); diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index dff41dd86df..7bd4e50857e 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -322,10 +322,10 @@ void EnInsect_Crawl(EnInsect* this, PlayState* play) { if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 1600.0f || (this->actionTimer < 4)) { yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); - Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); + Math_RotationStepToS(&this->actor.world.rot.y, yaw, 2000); } else if (this->actor.child != NULL && &this->actor != this->actor.child) { yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos); - Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); + Math_RotationStepToS(&this->actor.world.rot.y, yaw, 2000); } this->actor.shape.rot.y = this->actor.world.rot.y; @@ -368,7 +368,7 @@ void EnInsect_RunFromPlayer(EnInsect* this, PlayState* play) { if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 25600.0f || this->actionTimer < 4) { yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); - Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); + Math_RotationStepToS(&this->actor.world.rot.y, yaw, 2000); } else if (playerIsClose) { frames = play->state.frames; yaw = this->actor.yawTowardsPlayer + 0x8000; @@ -383,7 +383,7 @@ void EnInsect_RunFromPlayer(EnInsect* this, PlayState* play) { } } if (play) {} // Must be 'play' - Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); + Math_RotationStepToS(&this->actor.world.rot.y, yaw, 2000); } this->actor.shape.rot.y = this->actor.world.rot.y; this->skelAnime.playSpeed = CLAMP(this->actor.speed * 1.6f, 0.8f, 1.9f); @@ -513,7 +513,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) { this->unk_318 = CLAMP(this->unk_318, -temp_v1, temp_v1); this->actor.shape.rot.y += this->unk_318; - Math_ScaledStepToS(&this->actor.world.rot.x, 0, 3000); + Math_RotationStepToS(&this->actor.world.rot.x, 0, 3000); this->actor.shape.rot.x = this->actor.world.rot.x; if (Rand_ZeroOne() < 0.03f) { @@ -654,8 +654,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { Math_SmoothStepToF(&this->actor.speed, this->unk_324, 0.1f, 0.5f, 0.0f); - Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_328, 2000); - sp50 = Math_ScaledStepToS(&this->actor.world.rot.x, 0, 2000); + Math_RotationStepToS(&this->actor.world.rot.y, this->unk_328, 2000); + sp50 = Math_RotationStepToS(&this->actor.world.rot.x, 0, 2000); this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.x = this->actor.world.rot.x; } else { diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index c848b597dc3..a730f08d31d 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -333,7 +333,7 @@ void EnKarebaba_Dying(EnKarebaba* this, PlayState* play) { Math_StepToF(&this->actor.speed, 0.0f, 0.1f); if (this->actor.params == 0) { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); if (this->actor.scale.x > 0.005f && diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index b4add29656d..bae6871b1f5 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -192,7 +192,7 @@ void EnPoRelay_CorrectY(EnPoRelay* this) { } void EnPoRelay_Idle(EnPoRelay* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; this->actionFunc = EnPoRelay_Talk; @@ -205,7 +205,7 @@ void EnPoRelay_Idle(EnPoRelay* this, PlayState* play) { } void EnPoRelay_Talk(EnPoRelay* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (Actor_TextboxIsClosing(&this->actor, play)) { Actor_SetTextWithPrefix(play, &this->actor, 0x2F); this->textId = this->actor.textId; @@ -295,7 +295,7 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) { } void EnPoRelay_EndRace(EnPoRelay* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.y, -0x4000, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.y, -0x4000, 0x800); if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnPoRelay_Talk2; } else if (play->roomCtx.curRoom.num == 5) { @@ -309,7 +309,7 @@ void EnPoRelay_EndRace(EnPoRelay* this, PlayState* play) { } void EnPoRelay_Talk2(EnPoRelay* this, PlayState* play) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) { if (Message_ShouldAdvance(play)) { if (this->hookshotSlotFull) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index bac5e73916f..671cca0e121 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -639,10 +639,10 @@ void func_80ADA530(EnPoSisters* this, PlayState* play) { func_80AD9368(this); } if (this->actor.bgCheckFlags & BGCHECKFLAG_WALL) { - Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + Math_RotationStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x71C); } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { - Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + Math_RotationStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x71C); } } @@ -655,11 +655,11 @@ void func_80ADA6A0(EnPoSisters* this, PlayState* play) { temp_v0 = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; Math_StepToF(&this->actor.speed, 2.0f, 0.2f); if (temp_v0 > 0x3000) { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); } else if (temp_v0 < -0x3000) { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); } else { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); } if (this->actor.xzDistToPlayer < 160.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD944C(this); @@ -734,7 +734,7 @@ void func_80ADAAA4(EnPoSisters* this, PlayState* play) { } } if (this->unk_195 != 0) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.parent->shape.rot.y, + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.parent->shape.rot.y, (this->unk_195 == 2) ? 0x800 : 0x400); this->unk_22E.a = ((this->skelAnime.endFrame - this->skelAnime.curFrame) * 255.0f) / this->skelAnime.endFrame; this->actor.world.pos.y = this->actor.parent->world.pos.y; @@ -746,7 +746,7 @@ void func_80ADAAA4(EnPoSisters* this, PlayState* play) { void func_80ADAC70(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 1820); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 1820); if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } @@ -944,7 +944,7 @@ void func_80ADB51C(EnPoSisters* this, PlayState* play) { if (this->unk_195 == 2) { phi_a2 *= 2; } - Math_ScaledStepToS(&this->actor.shape.rot.y, + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.parent->shape.rot.y + (this->unk_195 * 0x4000) * phi_v0, phi_a2); } else if (this->unk_19A == 70 || this->unk_19A == 40) { Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -1041,14 +1041,14 @@ void func_80ADBB6C(EnPoSisters* this, PlayState* play) { if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 10.0f) { func_80ADA028(this); } else { - Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + Math_RotationStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 1820); } } void func_80ADBBF4(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1820); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1820); if (this->actor.xzDistToPlayer < 240.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD93C4(this); } @@ -1113,7 +1113,7 @@ void func_80ADBEE8(EnPoSisters* this, PlayState* play) { void func_80ADBF58(EnPoSisters* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->unk_19A--; - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x500); + Math_RotationStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x500); if (this->unk_19A == 0 && this->unk_194 == 0) { play->envCtx.lightSettingOverride = 4; } diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 061720f0db5..3c48cb18537 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -490,7 +490,7 @@ void func_80ADEA5C(EnPoh* this) { if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f) { this->unk_19C = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } - Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->unk_19C, 0x71C); } void func_80ADEAC4(EnPoh* this, PlayState* play) { @@ -542,11 +542,11 @@ void func_80ADEC9C(EnPoh* this, PlayState* play) { } facingDiff = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; if (facingDiff >= 0x3001) { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); } else if (facingDiff < -0x3000) { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); } else { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); } EnPoh_MoveTowardsPlayerHeight(this, play); if (this->actor.xzDistToPlayer > 280.0f) { @@ -570,7 +570,7 @@ void EnPoh_Attack(EnPoh* this, PlayState* play) { } EnPoh_MoveTowardsPlayerHeight(this, play); if (this->unk_198 >= 10) { - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xE38); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xE38); } else if (this->unk_198 == 9) { this->actor.speed = 5.0f; this->skelAnime.playSpeed = 2.0f; @@ -678,7 +678,7 @@ void func_80ADF574(EnPoh* this, PlayState* play) { void func_80ADF5E0(EnPoh* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 1820) != 0) { + if (Math_RotationStepToS(&this->actor.world.rot.y, this->unk_19C, 1820) != 0) { EnPoh_SetupIdle(this); } if (this->actor.xzDistToPlayer < 200.0f) { @@ -719,7 +719,7 @@ void func_80ADF894(EnPoh* this, PlayState* play) { multiplier = Math_SinS(this->unk_195 * 0x800) * 3.0f; this->actor.world.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y); this->actor.world.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y); - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x71C); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x71C); EnPoh_MoveTowardsPlayerHeight(this, play); if (this->unk_198 == 0 || this->actor.xzDistToPlayer > 250.0f) { this->actor.world.rot.y = this->actor.shape.rot.y; diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index f493c4fd8ae..732070e4e86 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -356,7 +356,7 @@ void EnWallmas_Stand(EnWallmas* this, PlayState* play) { EnWallmas_SetupWalk(this); } - Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0xB6); + Math_RotationStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0xB6); } void EnWallmas_Walk(EnWallmas* this, PlayState* play) { @@ -364,7 +364,7 @@ void EnWallmas_Walk(EnWallmas* this, PlayState* play) { EnWallmas_SetupJumpToCeiling(this); } - Math_ScaledStepToS(&this->actor.world.rot.y, (s16)((s32)this->actor.yawTowardsPlayer + 0x8000), 0xB6); + Math_RotationStepToS(&this->actor.world.rot.y, (s16)((s32)this->actor.yawTowardsPlayer + 0x8000), 0xB6); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f) || Animation_OnFrame(&this->skelAnime, 24.0f) || Animation_OnFrame(&this->skelAnime, 36.0f)) { diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 7092c4651b7..373175949a8 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -248,7 +248,7 @@ void EnWeiyer_FreeSwim(EnWeiyer* this, PlayState* play) { f32 curFrame; SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x800); animRestarted = Animation_OnFrame(&this->skelAnime, 0.0f); curFrame = this->skelAnime.curFrame; Math_StepToF(&this->swimHeight, this->targetSwimHeight, 0.5f); @@ -265,7 +265,7 @@ void EnWeiyer_FreeSwim(EnWeiyer* this, PlayState* play) { this->timer = 30; } - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 182)) { + if (Math_RotationStepToS(&this->actor.shape.rot.y, this->targetYaw, 182)) { if (this->timer != 0) { this->timer--; } @@ -311,7 +311,7 @@ void EnWeiyer_TurnAround(EnWeiyer* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (this->timer == 0) { - if (Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x800)) { + if (Math_RotationStepToS(&this->actor.shape.rot.x, -0x4000, 0x800)) { this->actor.shape.rot.z = 0; this->actor.shape.rot.y += 0x8000; this->timer = 1; @@ -319,7 +319,7 @@ void EnWeiyer_TurnAround(EnWeiyer* this, PlayState* play) { this->actor.shape.rot.z = this->actor.shape.rot.x * 2; } } else { - Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1800, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, 0x1800, 0x800); if (this->actor.world.pos.y < this->actor.home.pos.y) { if (this->actor.shape.rot.x > 0) { @@ -341,7 +341,7 @@ void EnWeiyer_StuckOnFloor(EnWeiyer* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_FLUTTER); } - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x800); Math_StepToF(&this->actor.speed, 0.0f, 1.0f); if (this->timer != 0) { @@ -411,7 +411,7 @@ void EnWeiyer_Inactive(EnWeiyer* this, PlayState* play) { f32 curFrame; SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x800); curFrame = this->skelAnime.curFrame; Math_StepToF(&this->swimHeight, (this->actor.home.pos.y - this->actor.floorHeight) / 4.0f + this->actor.floorHeight, 1.0f); @@ -461,8 +461,8 @@ void EnWeiyer_Hurt(EnWeiyer* this, PlayState* play) { this->targetYaw = this->actor.yawTowardsPlayer + 0x8000; } - Math_ScaledStepToS(&this->actor.world.rot.y, this->targetYaw, 0x38E); - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x200); + Math_RotationStepToS(&this->actor.world.rot.y, this->targetYaw, 0x38E); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x200); this->actor.shape.rot.z = sinf(this->timer * (M_PI / 5)) * 5120.0f; if (this->timer == 0) { @@ -474,7 +474,7 @@ void EnWeiyer_Hurt(EnWeiyer* this, PlayState* play) { void EnWeiyer_Die(EnWeiyer* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.shape.rot.x, -0x4000, 0x400); + Math_RotationStepToS(&this->actor.shape.rot.x, -0x4000, 0x400); this->actor.shape.rot.z += 0x1000; if (this->timer != 0) { @@ -502,8 +502,8 @@ void EnWeiyer_Stunned(EnWeiyer* this, PlayState* play) { this->timer--; } - Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x200); - Math_ScaledStepToS(&this->actor.shape.rot.z, 0, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.x, 0, 0x200); + Math_RotationStepToS(&this->actor.shape.rot.z, 0, 0x200); SkelAnime_Update(&this->skelAnime); if (this->actor.home.pos.y < this->actor.floorHeight) { @@ -556,7 +556,7 @@ void EnWeiyer_OutOfWater(EnWeiyer* this, PlayState* play) { } if (this->actor.shape.rot.x < pitch) { - Math_ScaledStepToS(&this->actor.shape.rot.x, pitch, 0x400); + Math_RotationStepToS(&this->actor.shape.rot.x, pitch, 0x400); } if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 6f41073c4be..61b5b0d3dc9 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -230,7 +230,7 @@ void func_80B8EE24(ObjBean* this) { Math_StepToF(&this->posOffsetX, 0.0f, 0.1f); Math_StepToF(&this->posOffsetZ, 0.0f, 0.1f); - Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x64); + Math_RotationStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x64); } void ObjBean_Move(ObjBean* this) { diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 6490db46ae2..b9f3c21b4fe 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -98,8 +98,8 @@ void ObjHamishi_Shake(ObjHamishi* this) { } else { Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f); Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.home.rot.x, 0xBB8); - Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0xBB8); + Math_RotationStepToS(&this->actor.shape.rot.x, this->actor.home.rot.x, 0xBB8); + Math_RotationStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0xBB8); } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 84dd1e6f522..35a32f0d7d8 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -3148,7 +3148,7 @@ s32 func_808351D4(Player* this, PlayState* play) { sp2C = 1; } - Math_ScaledStepToS(&this->upperLimbRot.z, 1200, 400); + Math_RotationStepToS(&this->upperLimbRot.z, 1200, 400); this->unk_6AE_rotFlags |= UNK6AE_ROT_UPPER_Z; if ((this->unk_836 == 0) && (Player_CheckForIdleAnim(this) == IDLE_ANIM_NONE) && @@ -3776,14 +3776,14 @@ void Player_UpdateShapeYaw(Player* this, PlayState* play) { if ((focusActor != NULL) && ((play->actorCtx.attention.reticleSpinCounter != 0) || (this->actor.category != ACTORCAT_PLAYER))) { - Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &focusActor->focus.pos), + Math_RotationStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &focusActor->focus.pos), 4000); } else if ((this->stateFlags1 & PLAYER_STATE1_PARALLEL) && !(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->parallelYaw, 4000); + Math_RotationStepToS(&this->actor.shape.rot.y, this->parallelYaw, 4000); } } else if (!(this->stateFlags2 & PLAYER_STATE2_6)) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->yaw, 2000); + Math_RotationStepToS(&this->actor.shape.rot.y, this->yaw, 2000); } this->unk_87C = this->actor.shape.rot.y - previousYaw; @@ -3809,7 +3809,7 @@ s32 Player_ScaledStepBinangClamped(s16* pValue, s16 target, s16 step, s16 overfl clampedDiff = CLAMP(clampedDiff, -constraintRange, constraintRange); *pValue += (s16)(diff - clampedDiff); - Math_ScaledStepToS(pValue, target, step); + Math_RotationStepToS(pValue, target, step); valueBeforeOverflowClamp = *pValue; if (*pValue < -overflowRange) { @@ -7149,11 +7149,11 @@ void func_8083DDC8(Player* this, PlayState* play) { targetPitch = CLAMP(targetPitch, -4000, 4000); targetRoll = CLAMP(-targetRoll, -4000, 4000); - Math_ScaledStepToS(&this->upperLimbRot.x, targetPitch, 900); + Math_RotationStepToS(&this->upperLimbRot.x, targetPitch, 900); this->headLimbRot.x = -(f32)this->upperLimbRot.x * 0.5f; - Math_ScaledStepToS(&this->headLimbRot.z, targetRoll, 300); - Math_ScaledStepToS(&this->upperLimbRot.z, targetRoll, 200); + Math_RotationStepToS(&this->headLimbRot.z, targetRoll, 300); + Math_RotationStepToS(&this->upperLimbRot.z, targetRoll, 200); this->unk_6AE_rotFlags |= UNK6AE_ROT_HEAD_X | UNK6AE_ROT_HEAD_Z | UNK6AE_ROT_UPPER_X | UNK6AE_ROT_UPPER_Z; } else { @@ -7163,7 +7163,7 @@ void func_8083DDC8(Player* this, PlayState* play) { void func_8083DF68(Player* this, f32 arg1, s16 arg2) { Math_AsymStepToF(&this->speedXZ, arg1, REG(19) / 100.0f, 1.5f); - Math_ScaledStepToS(&this->yaw, arg2, REG(27)); + Math_RotationStepToS(&this->yaw, arg2, REG(27)); } void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { @@ -7179,7 +7179,7 @@ void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { } } else { Math_AsymStepToF(&this->speedXZ, *arg1, 0.05f, 0.1f); - Math_ScaledStepToS(&this->yaw, *arg2, 200); + Math_RotationStepToS(&this->yaw, *arg2, 200); } } @@ -7709,7 +7709,7 @@ s32 func_8083F360(PlayState* play, Player* this, f32 arg1, f32 arg2, f32 arg3, f wallPolyNormalX = COLPOLY_GET_NORMAL(wallPoly->normal.x); wallPolyNormalZ = COLPOLY_GET_NORMAL(wallPoly->normal.z); temp = Math_Atan2S(-wallPolyNormalZ, -wallPolyNormalX); - Math_ScaledStepToS(&this->actor.shape.rot.y, temp, 800); + Math_RotationStepToS(&this->actor.shape.rot.y, temp, 800); this->yaw = this->actor.shape.rot.y; this->actor.world.pos.x = sp54.x - (Math_SinS(this->actor.shape.rot.y) * arg2); @@ -8133,7 +8133,7 @@ void Player_Action_80840450(Player* this, PlayState* play) { Math_AsymStepToF(&this->speedXZ, speedTarget * 0.3f, 2.0f, 1.5f); if (!(this->stateFlags3 & PLAYER_STATE3_3)) { - Math_ScaledStepToS(&this->yaw, yawTarget, temp4 * 0.1f); + Math_RotationStepToS(&this->yaw, yawTarget, temp4 * 0.1f); } } } @@ -8343,7 +8343,7 @@ void Player_Action_Idle(Player* this, PlayState* play) { return; } - Math_ScaledStepToS(&this->actor.shape.rot.y, yawTarget, 1200); + Math_RotationStepToS(&this->actor.shape.rot.y, yawTarget, 1200); this->yaw = this->actor.shape.rot.y; if (Player_GetIdleAnim(this) == this->skelAnime.animation) { @@ -8439,7 +8439,7 @@ void Player_Action_80840DE4(Player* this, PlayState* play) { } Math_AsymStepToF(&this->speedXZ, speedTarget * 0.4f, 1.5f, 1.5f); - Math_ScaledStepToS(&this->yaw, yawTarget, temp3 * 0.1f); + Math_RotationStepToS(&this->yaw, yawTarget, temp3 * 0.1f); } } @@ -8539,7 +8539,7 @@ void Player_Action_808414F8(Player* this, PlayState* play) { s16 sp2A = yawTarget - this->yaw; Math_AsymStepToF(&this->speedXZ, speedTarget * 1.5f, 1.5f, 2.0f); - Math_ScaledStepToS(&this->yaw, yawTarget, sp2A * 0.1f); + Math_RotationStepToS(&this->yaw, yawTarget, sp2A * 0.1f); if ((speedTarget == 0.0f) && (this->speedXZ == 0.0f)) { func_80839F30(this, play); @@ -8649,7 +8649,7 @@ void Player_Action_8084193C(Player* this, PlayState* play) { } else { speedTarget *= 0.9f; Math_AsymStepToF(&this->speedXZ, speedTarget, 2.0f, 3.0f); - Math_ScaledStepToS(&this->yaw, yawTarget, temp3 * 0.1f); + Math_RotationStepToS(&this->yaw, yawTarget, temp3 * 0.1f); } } } @@ -8689,7 +8689,7 @@ void Player_Action_TurnInPlace(Player* this, PlayState* play) { if (speedTarget != 0.0f) { this->actor.shape.rot.y = yawTarget; func_8083C858(this, play); - } else if (Math_ScaledStepToS(&this->actor.shape.rot.y, yawTarget, this->turnRate)) { + } else if (Math_RotationStepToS(&this->actor.shape.rot.y, yawTarget, this->turnRate)) { func_8083C0E8(this, play); } @@ -8708,7 +8708,7 @@ void func_80841CC4(Player* this, s32 arg1, PlayState* play) { target = CLAMP(sFloorShapePitch, -10922, 10922); } - Math_ScaledStepToS(&this->unk_89C, target, 400); + Math_RotationStepToS(&this->unk_89C, target, 400); if ((this->modelAnimType == PLAYER_ANIMTYPE_3) || ((this->unk_89C == 0) && (this->unk_6C4 <= 0.0f))) { if (arg1 == 0) { @@ -9202,9 +9202,9 @@ void Player_Action_80843188(Player* this, PlayState* play) { sp46 = 50; } - Math_ScaledStepToS(&this->actor.focus.rot.x, sp4C, sp48); + Math_RotationStepToS(&this->actor.focus.rot.x, sp4C, sp48); this->upperLimbRot.x = this->actor.focus.rot.x; - Math_ScaledStepToS(&this->upperLimbRot.y, sp4A, sp46); + Math_RotationStepToS(&this->upperLimbRot.y, sp4A, sp46); if (this->av1.actionVar1 != 0) { if (!func_80842DF4(play, this)) { @@ -9970,7 +9970,7 @@ void Player_Action_80845000(Player* this, PlayState* play) { } Math_AsymStepToF(&this->speedXZ, speedTarget * 0.2f, 1.0f, 0.5f); - Math_ScaledStepToS(&this->yaw, yawTarget, sp44 * 0.1f); + Math_RotationStepToS(&this->yaw, yawTarget, sp44 * 0.1f); if ((speedTarget == 0.0f) && (this->speedXZ == 0.0f)) { func_80844DC8(this, play); @@ -10038,7 +10038,7 @@ void Player_Action_80845308(Player* this, PlayState* play) { } Math_AsymStepToF(&this->speedXZ, speedTarget * 0.2f, 1.0f, 0.5f); - Math_ScaledStepToS(&this->yaw, yawTarget, sp44 * 0.1f); + Math_RotationStepToS(&this->yaw, yawTarget, sp44 * 0.1f); if ((speedTarget == 0.0f) && (this->speedXZ == 0.0f) && (sp5C == 0.0f)) { func_80844DC8(this, play); @@ -10329,7 +10329,7 @@ void Player_Action_80846050(Player* this, PlayState* play) { this->unk_3BC.y = interactRangeActor->shape.rot.y - this->actor.shape.rot.y; } } else { - Math_ScaledStepToS(&this->unk_3BC.y, 0, 4000); + Math_RotationStepToS(&this->unk_3BC.y, 0, 4000); } } @@ -10833,7 +10833,7 @@ void Player_ApproachZeroBinang(s16* pValue) { step = ABS(*pValue) * 100.0f / 1000.0f; step = CLAMP(step, 400, 4000); - Math_ScaledStepToS(pValue, 0, step); + Math_RotationStepToS(pValue, 0, step); } void func_80847298(Player* this) { @@ -11788,7 +11788,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->unk_844--; } - Math_ScaledStepToS(&this->unk_6C2, 0, 400); + Math_RotationStepToS(&this->unk_6C2, 0, 400); FaceChange_UpdateBlinking(&this->faceChange, 20, 80, 6); this->actor.shape.face = this->faceChange.face + ((play->gameplayFrames & 32) ? 0 : 3); @@ -11826,7 +11826,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { step = (fabsf(this->speedXZ) * 700.0f) - (fabsf(this->actor.speed) * 100.0f); step = CLAMP(step, 0, 1350); - Math_ScaledStepToS(&this->actor.world.rot.y, yawTarget, step); + Math_RotationStepToS(&this->actor.world.rot.y, yawTarget, step); } if ((this->speedXZ == 0.0f) && (this->actor.speed != 0.0f)) { @@ -11897,7 +11897,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Math_StepToF(&this->pushedSpeed, conveyorSpeed, conveyorSpeed * 0.1f); - Math_ScaledStepToS(&this->pushedYaw, sConveyorYaw, + Math_RotationStepToS(&this->pushedYaw, sConveyorYaw, ((this->stateFlags1 & PLAYER_STATE1_27) ? 400.0f : 800.0f) * conveyorSpeed); } else if (this->pushedSpeed != 0.0f) { Math_StepToF(&this->pushedSpeed, 0.0f, (this->stateFlags1 & PLAYER_STATE1_27) ? 0.5f : 1.0f); @@ -12409,7 +12409,7 @@ void func_8084AEEC(Player* this, f32* arg1, f32 arg2, s16 arg3) { } Math_AsymStepToF(arg1, arg2 * 0.8f, temp1, (fabsf(*arg1) * 0.02f) + 0.05f); - Math_ScaledStepToS(&this->yaw, arg3, 1600); + Math_RotationStepToS(&this->yaw, arg3, 1600); } void func_8084B000(Player* this) { @@ -12773,7 +12773,7 @@ void Player_Action_8084BBE4(Player* this, PlayState* play) { } } - Math_ScaledStepToS(&this->actor.shape.rot.y, this->yaw, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.y, this->yaw, 0x800); if (this->av1.actionVar1 != 0) { Player_GetMovementSpeedAndYaw(this, &speedTarget, &yawTarget, SPEED_MODE_LINEAR, play); @@ -13655,7 +13655,7 @@ void Player_Action_8084DC48(Player* this, PlayState* play) { } func_8084B158(play, this, sControlInput, fabsf(this->actor.velocity.y)); - Math_ScaledStepToS(&this->unk_6C2, -10000, 800); + Math_RotationStepToS(&this->unk_6C2, -10000, 800); if (sp2C > 8.0f) { sp2C = 8.0f; @@ -13922,7 +13922,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) { } if (this->skelAnime.animation == &gPlayerAnim_link_demo_get_itemB) { - Math_ScaledStepToS(&this->actor.shape.rot.y, Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000, 4000); + Math_RotationStepToS(&this->actor.shape.rot.y, Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000, 4000); } if (LinkAnimation_OnFrame(&this->skelAnime, 21.0f)) { @@ -14307,7 +14307,7 @@ void Player_Action_SlideOnSlope(Player* this, PlayState* play) { } Math_SmoothStepToS(&this->yaw, downwardSlopeYaw, 10, 4000, 800); - Math_ScaledStepToS(&this->actor.shape.rot.y, shapeYawTarget, 2000); + Math_RotationStepToS(&this->actor.shape.rot.y, shapeYawTarget, 2000); } } @@ -14706,7 +14706,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) { shockwavePos.y = func_8083973C(play, this, &D_80854A40, &shockwavePos); sp2C = this->actor.world.pos.y - shockwavePos.y; - Math_ScaledStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800); + Math_RotationStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800); func_80836AB8(this, true); if ((((this->meleeWeaponAnimation == PLAYER_MWA_HAMMER_FORWARD) && @@ -14920,7 +14920,7 @@ void Player_Action_HookshotFly(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_2; } else if ((this->skelAnime.animation != &gPlayerAnim_link_hook_fly_start) || (4.0f <= this->skelAnime.curFrame)) { this->actor.gravity = 0.0f; - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0x800); + Math_RotationStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0x800); Player_RequestRumble(this, 100, 2, 100, 0); } } @@ -15347,7 +15347,7 @@ void func_808513BC(PlayState* play, Player* this, CsCmdActorCue* cue) { this->av1.actionVar1 = 1; } else { func_8084B158(play, this, NULL, fabsf(this->actor.velocity.y)); - Math_ScaledStepToS(&this->unk_6C2, -10000, 800); + Math_RotationStepToS(&this->unk_6C2, -10000, 800); func_8084AEEC(this, &this->actor.velocity.y, 4.0f, this->yaw); } return; diff --git a/tools/namefixer.py b/tools/namefixer.py index 0877e2893ec..4ee8550f0c2 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -150,7 +150,7 @@ "atan2s(":"Math_Atan2S(", "Math_Coss(":"Math_CosS(", "Math_Sins(":"Math_SinS(", - "Math_ApproxUpdateScaledS(":"Math_ScaledStepToS(", + "Math_ApproxUpdateScaledS(":"Math_RotationStepToS(", "Math_ApproxS(":"Math_StepToS(", "Math_ApproxF(":"Math_StepToF(", "func_80077A90(":"Math_StepUntilAngleS(",