actor math cleanup (#1187)

This commit is contained in:
engineer124 2023-03-02 19:16:00 -05:00 committed by GitHub
parent 263fca77c3
commit 5729b6d3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 315 additions and 293 deletions

View File

@ -635,16 +635,16 @@ void Actor_MoveWithoutGravity(Actor* actor);
void Actor_UpdateVelocityWithoutGravityReverse(Actor* actor);
void Actor_MoveWithoutGravityReverse(Actor* actor);
void Actor_SetSpeeds(Actor* actor, f32 speed);
s16 Actor_YawBetweenActors(Actor* from, Actor* to);
s16 Actor_YawBetweenActorsTop(Actor* from, Actor* to);
s16 Actor_YawToPoint(Actor* actor, Vec3f* point);
s16 Actor_PitchBetweenActors(Actor* from, Actor* to);
s16 Actor_PitchBetweenActorsTop(Actor* from, Actor* to);
s16 Actor_PitchToPoint(Actor* actor, Vec3f* point);
f32 Actor_DistanceBetweenActors(Actor* actor1, Actor* actor2);
f32 Actor_DistanceToPoint(Actor* actor, Vec3f* point);
f32 Actor_XZDistanceBetweenActors(Actor* actor1, Actor* actor2);
f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point);
s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB);
s16 Actor_FocusYawTowardActor(Actor* actorA, Actor* actorB);
s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint);
s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB);
s16 Actor_FocusPitchTowardActor(Actor* actorA, Actor* actorB);
s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint);
f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB);
f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint);
f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB);
f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint);
void Actor_OffsetOfPointInActorCoords(Actor* actor, Vec3f* offset, Vec3f* point);
f32 Actor_HeightDiff(Actor* actor1, Actor* actor2);
void func_800B6F20(PlayState* play, Input* input, f32 magnitude, s16 baseYaw);

View File

@ -1207,44 +1207,44 @@ void Actor_UpdatePosFromSkelAnime(Actor* actor, SkelAnime* skelAnime) {
actor->world.pos.z += pos.z * actor->scale.z;
}
s16 Actor_YawBetweenActors(Actor* from, Actor* to) {
return Math_Vec3f_Yaw(&from->world.pos, &to->world.pos);
s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Yaw(&actorA->world.pos, &actorB->world.pos);
}
s16 Actor_YawBetweenActorsTop(Actor* from, Actor* to) {
return Math_Vec3f_Yaw(&from->focus.pos, &to->focus.pos);
s16 Actor_FocusYawTowardActor(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Yaw(&actorA->focus.pos, &actorB->focus.pos);
}
s16 Actor_YawToPoint(Actor* actor, Vec3f* point) {
return Math_Vec3f_Yaw(&actor->world.pos, point);
s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint) {
return Math_Vec3f_Yaw(&actor->world.pos, refPoint);
}
s16 Actor_PitchBetweenActors(Actor* from, Actor* to) {
return Math_Vec3f_Pitch(&from->world.pos, &to->world.pos);
s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Pitch(&actorA->world.pos, &actorB->world.pos);
}
s16 Actor_PitchBetweenActorsTop(Actor* from, Actor* to) {
return Math_Vec3f_Pitch(&from->focus.pos, &to->focus.pos);
s16 Actor_FocusPitchTowardActor(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Pitch(&actorA->focus.pos, &actorB->focus.pos);
}
s16 Actor_PitchToPoint(Actor* actor, Vec3f* point) {
return Math_Vec3f_Pitch(&actor->world.pos, point);
s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint) {
return Math_Vec3f_Pitch(&actor->world.pos, refPoint);
}
f32 Actor_DistanceBetweenActors(Actor* actor1, Actor* actor2) {
return Math_Vec3f_DistXYZ(&actor1->world.pos, &actor2->world.pos);
f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB) {
return Math_Vec3f_DistXYZ(&actorA->world.pos, &actorB->world.pos);
}
f32 Actor_DistanceToPoint(Actor* actor, Vec3f* point) {
return Math_Vec3f_DistXYZ(&actor->world.pos, point);
f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint) {
return Math_Vec3f_DistXYZ(&actor->world.pos, refPoint);
}
f32 Actor_XZDistanceBetweenActors(Actor* actor1, Actor* actor2) {
return Math_Vec3f_DistXZ(&actor1->world.pos, &actor2->world.pos);
f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB) {
return Math_Vec3f_DistXZ(&actorA->world.pos, &actorB->world.pos);
}
f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point) {
return Math_Vec3f_DistXZ(&actor->world.pos, point);
f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) {
return Math_Vec3f_DistXZ(&actor->world.pos, refPoint);
}
/**
@ -1416,7 +1416,7 @@ s32 Player_IsFacingActor(Actor* actor, s16 maxAngleDiff, PlayState* play) {
* This function is unused in the original game.
*/
s32 Actor_ActorBIsFacingActorA(Actor* actorA, Actor* actorB, s16 maxAngleDiff) {
s16 angle = BINANG_ROT180(Actor_YawBetweenActors(actorA, actorB));
s16 angle = BINANG_ROT180(Actor_WorldYawTowardActor(actorA, actorB));
s16 dist = angle - actorB->shape.rot.y;
if (ABS_ALT(dist) < maxAngleDiff) {
@ -1444,7 +1444,7 @@ s32 Actor_IsFacingPlayer(Actor* actor, s16 angle) {
* The maximum angle difference that qualifies as "facing" is specified by `maxAngleDiff`.
*/
s32 Actor_ActorAIsFacingActorB(Actor* actorA, Actor* actorB, s16 maxAngleDiff) {
s16 dist = Actor_YawBetweenActors(actorA, actorB) - actorA->shape.rot.y;
s16 dist = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y;
if (ABS_ALT(dist) < maxAngleDiff) {
return true;
@ -1477,8 +1477,8 @@ s32 Actor_IsFacingAndNearPlayer(Actor* actor, f32 range, s16 maxAngleDiff) {
* The maximum distance that qualifies as "nearby" is specified by `range`.
*/
s32 Actor_ActorAIsFacingAndNearActorB(Actor* actorA, Actor* actorB, f32 range, s16 maxAngleDiff) {
if (Actor_DistanceBetweenActors(actorA, actorB) < range) {
s16 dist = Actor_YawBetweenActors(actorA, actorB) - actorA->shape.rot.y;
if (Actor_WorldDistXYZToActor(actorA, actorB) < range) {
s16 dist = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y;
if (ABS_ALT(dist) < maxAngleDiff) {
return true;
@ -2362,11 +2362,11 @@ Actor* Actor_UpdateActor(UpdateActor_Params* params) {
CollisionCheck_ResetDamage(&actor->colChkInfo);
} else {
Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos);
actor->xzDistToPlayer = Actor_XZDistanceBetweenActors(actor, &params->player->actor);
actor->xzDistToPlayer = Actor_WorldDistXZToActor(actor, &params->player->actor);
actor->playerHeightRel = Actor_HeightDiff(actor, &params->player->actor);
actor->xyzDistToPlayerSq = SQ(actor->xzDistToPlayer) + SQ(actor->playerHeightRel);
actor->yawTowardsPlayer = Actor_YawBetweenActors(actor, &params->player->actor);
actor->yawTowardsPlayer = Actor_WorldYawTowardActor(actor, &params->player->actor);
actor->flags &= ~ACTOR_FLAG_1000000;
if ((DECR(actor->freezeTimer) == 0) && (actor->flags & params->unk_18)) {
@ -3584,8 +3584,8 @@ s32 func_800BC188(s32 index) {
}
s32 func_800BC1B4(Actor* actor, Actor* arg1, f32 arg2, f32 arg3) {
if ((arg3 > 0.0f) && (Actor_DistanceBetweenActors(arg1, actor) < ((arg3 * 2.5f) + arg2))) {
s16 temp_v1 = BINANG_SUB(Actor_YawBetweenActors(arg1, actor), arg1->world.rot.y);
if ((arg3 > 0.0f) && (Actor_WorldDistXYZToActor(arg1, actor) < ((arg3 * 2.5f) + arg2))) {
s16 temp_v1 = BINANG_SUB(Actor_WorldYawTowardActor(arg1, actor), arg1->world.rot.y);
if (ABS_ALT(temp_v1) < 0x1400) {
return true;
@ -4296,7 +4296,7 @@ Actor* Actor_FindNearby(PlayState* play, Actor* inActor, s16 actorId, u8 actorCa
continue;
}
if (Actor_DistanceBetweenActors(inActor, actor) <= distance) {
if (Actor_WorldDistXYZToActor(inActor, actor) <= distance) {
return actor;
}
@ -4416,7 +4416,7 @@ void func_800BE504(Actor* actor, ColliderCylinder* collider) {
if ((collider->info.acHitInfo->toucher.dmgFlags & (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20))) {
actor->world.rot.y = collider->base.ac->shape.rot.y;
} else {
actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor);
actor->world.rot.y = Actor_WorldYawTowardActor(collider->base.ac, actor);
}
}
@ -4424,7 +4424,7 @@ void func_800BE568(Actor* actor, ColliderSphere* collider) {
if (collider->info.acHitInfo->toucher.dmgFlags & (0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20)) {
actor->world.rot.y = collider->base.ac->shape.rot.y;
} else {
actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor);
actor->world.rot.y = Actor_WorldYawTowardActor(collider->base.ac, actor);
}
}
@ -4433,7 +4433,7 @@ void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 colliderIndex) {
(0x10000 | 0x2000 | 0x1000 | 0x800 | 0x20)) {
actor->world.rot.y = collider->base.ac->shape.rot.y;
} else {
actor->world.rot.y = Actor_YawBetweenActors(collider->base.ac, actor);
actor->world.rot.y = Actor_WorldYawTowardActor(collider->base.ac, actor);
}
}
@ -4733,7 +4733,7 @@ void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 l
SoundSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < limbPosCount; i++) {
yaw = Actor_YawToPoint(actor, limbPos);
yaw = Actor_WorldYawTowardPoint(actor, limbPos);
for (j = 0; j < effectsPerLimb; j++) {
randomYaw = ((s32)Rand_Next() >> 0x13) + yaw;

View File

@ -69,7 +69,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
do {
doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
door = (EnDoor*)doorIter;
dist = Actor_DistanceBetweenActors(actor, &door->dyna.actor);
dist = Actor_WorldDistXYZToActor(actor, &door->dyna.actor);
if (!isSetup || (dist < minDist)) {
nearestDoor = door;
minDist = dist;

View File

@ -517,7 +517,7 @@ Actor* SubS_FindNearestActor(Actor* actor, PlayState* play, u8 actorCategory, s1
actorIter = actorTmp;
if (actorIter != actor) {
dist = Actor_DistanceBetweenActors(actor, actorIter);
dist = Actor_WorldDistXYZToActor(actor, actorIter);
if (!isSetup || dist < minDist) {
closestActor = actorIter;
minDist = dist;
@ -1522,7 +1522,7 @@ s32 func_8013E748(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, s32 ex
s32 SubS_ActorAndPlayerFaceEachOther(PlayState* play, Actor* actor, void* data) {
Player* player = GET_PLAYER(play);
Vec3s* yawTols = (Vec3s*)data;
s16 playerYaw = ABS(BINANG_SUB(Actor_YawBetweenActors(&player->actor, actor), player->actor.shape.rot.y));
s16 playerYaw = ABS(BINANG_SUB(Actor_WorldYawTowardActor(&player->actor, actor), player->actor.shape.rot.y));
s16 actorYaw = ABS(BINANG_SUB(actor->yawTowardsPlayer, actor->shape.rot.y));
s32 areFacing = false;
s32 actorYawTol = ABS(yawTols->y);

View File

@ -168,7 +168,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) {
grabbed = NULL;
this->grabbed = NULL;
} else if (this->actor.child != NULL) {
f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed);
f32 sp94 = Actor_WorldDistXYZToActor(&this->actor, grabbed);
f32 sp90 = sqrtf(SQXYZ(this->unk1FC));
Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos);

View File

@ -1254,7 +1254,7 @@ void DmStk_ClockTower_AdjustHeightAndRotation(DmStk* this, PlayState* play) {
sin = Math_SinS(this->bobPhase) * 10.0f;
Math_SmoothStepToF(&this->actor.world.pos.y, 160.0f + sin, 0.2f, 1.0f, 0.0001f);
this->actor.world.rot.y = Actor_YawBetweenActors(&this->actor, &player->actor);
this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, &player->actor);
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.world.rot.x = 0x1B58;

View File

@ -652,7 +652,7 @@ s32 func_808A1D68(DoorShutter* this, PlayState* play) {
return true;
}
temp_a0 = BINANG_SUB(Actor_YawToPoint(&this->actor, &play->view.eye), this->actor.shape.rot.y);
temp_a0 = BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &play->view.eye), this->actor.shape.rot.y);
temp_a1 = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y);
temp_a0 = ABS_ALT(temp_a0);

View File

@ -307,7 +307,7 @@ void func_808B03C0(EnAm* this, PlayState* play) {
}
if (this->explodeTimer == 0) {
func_808B0640(this);
} else if ((this->returnHomeTimer == 0) || Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 240.0f) {
} else if ((this->returnHomeTimer == 0) || Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 240.0f) {
func_808B0460(this);
}
}
@ -315,7 +315,7 @@ void func_808B03C0(EnAm* this, PlayState* play) {
void func_808B0460(EnAm* this) {
this->actor.world.rot.y = this->actor.shape.rot.y;
this->speed = 0.0f;
this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->armosYaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actionFunc = func_808B04A8;
}
@ -345,15 +345,15 @@ void func_808B0508(EnAm* this, PlayState* play) {
void func_808B057C(EnAm* this) {
this->speed = 6.0f;
this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->armosYaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->explodeTimer = 1;
this->actionFunc = func_808B05C8;
}
void func_808B05C8(EnAm* this, PlayState* play) {
this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->armosYaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
func_808B0208(this, play);
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 8.0f) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 8.0f) {
func_808B04E4(this);
}
}

View File

@ -654,7 +654,7 @@ void func_80A95FE8(EnAz* this, PlayState* play) {
} else {
ActorCutscene_SetIntentToPlay(this->unk_3D0[0]);
}
if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) > 20.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) > 20.0f) {
func_800B9010(&this->actor, NA_SE_EV_BEAVER_SWIM_MOTOR - SFX_FLAG);
func_800BE33C(&this->actor.world.pos, &this->actor.home.pos, &this->actor.world.rot, 0);
Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 3, 0xE38, 0x38E);
@ -1615,7 +1615,7 @@ void func_80A98414(EnAz* this, PlayState* play) {
if ((fish->actor.params < 0) && (fish->actor.room == this->actor.room) &&
(Math3D_Vec3fDistSq(&this->actor.world.pos, &fish->actor.world.pos) < SQ(200.0f))) {
fish->unk_276 = 0x14;
fish->unk_274 = Actor_YawBetweenActors(&fish->actor, &this->actor);
fish->unk_274 = Actor_WorldYawTowardActor(&fish->actor, &this->actor);
}
}
itemAction = itemAction->next;

View File

@ -230,7 +230,7 @@ void EnBat_FlyIdle(EnBat* this, PlayState* play) {
this->yawTarget = this->actor.wallYaw;
} else if (Math3D_XZDistanceSquared(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z) > SQ(300.0f)) {
this->yawTarget = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->yawTarget = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
} else if (finishedRotStep && (Rand_ZeroOne() < 0.015f)) {
this->yawTarget =
this->actor.shape.rot.y + (((s32)(0x1000 * Rand_ZeroOne()) + 0x1000) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1));
@ -282,7 +282,7 @@ void EnBat_DiveAttack(EnBat* this, PlayState* play) {
preyPos.y = player->actor.world.pos.y + 20.0f;
preyPos.z = player->actor.world.pos.z;
pitchTarget = Actor_PitchToPoint(&this->actor, &preyPos);
pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &preyPos);
pitchTarget = CLAMP(pitchTarget, -0x3000, 0x3000);
Math_SmoothStepToS(&this->actor.shape.rot.x, pitchTarget, 2, 0x400, 0x40);
} else {

View File

@ -236,10 +236,10 @@ void EnBb_SetupFlyIdle(EnBb* this) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->flyHeightMod = (Math_CosS(this->bobPhase) * 10.0f) + 30.0f;
this->targetYRotation = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->targetYRotation = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
if ((this->actor.xzDistToPlayer < (this->attackRange + 120.0f)) ||
(Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 300.0f)) {
(Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 300.0f)) {
this->targetYRotation += (s16)((s32)Rand_Next() >> 0x11);
}
@ -299,7 +299,7 @@ void EnBb_Attack(EnBb* this, PlayState* play) {
if (((this->attackRange + 120.0f) < this->actor.xzDistToPlayer) || (this->timer == 0) ||
(Player_GetMask(play) == PLAYER_MASK_STONE) ||
(Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 400.0f)) {
(Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f)) {
EnBb_SetupFlyIdle(this);
}
}

View File

@ -133,7 +133,7 @@ void EnBigokuta_SetupCutsceneCamera(EnBigokuta* this, PlayState* play, Vec3f* su
this->subCamId = ActorCutscene_GetCurrentSubCamId(this->picto.actor.cutscene);
Play_SetCameraAtEye(play, this->subCamId, subCamAt, subCamEye);
angle = BINANG_SUB(Actor_YawToPoint(&this->picto.actor, subCamEye), this->picto.actor.home.rot.y);
angle = BINANG_SUB(Actor_WorldYawTowardPoint(&this->picto.actor, subCamEye), this->picto.actor.home.rot.y);
if (angle > 0) {
angle = BINANG_ADD(this->picto.actor.home.rot.y, 0x1800);
} else {
@ -475,7 +475,7 @@ s32 EnBigokuta_IsNearSwampBoat(EnBigokuta* this, PlayState* play) {
this->picto.actor.child = SubS_FindActor(play, NULL, ACTORCAT_BG, ACTOR_BG_INGATE);
if ((this->picto.actor.child != NULL) &&
(Actor_XZDistanceBetweenActors(&this->picto.actor, this->picto.actor.child) < 250.0f)) {
(Actor_WorldDistXZToActor(&this->picto.actor, this->picto.actor.child) < 250.0f)) {
return true;
} else {
return false;

View File

@ -431,7 +431,8 @@ void func_80A2844C(EnBigpamet* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime2);
if (this->actor.parent->params == GEKKO_RETURN_TO_SNAPPER) {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->actor.parent), 0x400);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->actor.parent),
0x400);
this->actor.world.rot.y = this->actor.shape.rot.y;
} else if (this->actor.parent->params == GEKKO_JUMP_ON_SNAPPER) {
this->actor.speedXZ = 0.0f;
@ -622,7 +623,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) {
if ((this->actor.draw == func_80A2966C) && (this->actionFunc != func_80A28DC0)) {
this->actor.draw = EnBigpamet_Draw;
} else if (this->collider.base.ac != NULL) {
this->actor.world.rot.y = BINANG_ROT180(Actor_YawBetweenActors(&this->actor, this->collider.base.ac));
this->actor.world.rot.y = BINANG_ROT180(Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac));
}
this->actor.shape.rot.y = this->actor.world.rot.y;
@ -638,7 +639,7 @@ void func_80A28B98(EnBigpamet* this, PlayState* play) {
collectible = Item_DropCollectible(play, &this->actor.world.pos, ITEM00_ARROWS_10);
if (collectible != NULL) {
collectible->velocity.y = 15.0f;
collectible->world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
collectible->world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_PAMET_REVERSE);

View File

@ -558,8 +558,8 @@ void EnBigpo_IdleFlying(EnBigpo* this, PlayState* play) {
this->actor.world.pos.y = (sin_rad(this->hoverHeightCycleTimer * (M_PI / 20)) * 10.0f) + this->savedHeight;
Math_StepToF(&this->actor.speedXZ, 3.0f, 0.2f);
func_800B9010(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG);
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->unk208 = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->unk208 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->unk208, 0x200) && (Rand_ZeroOne() < 0.075f)) {

View File

@ -1500,7 +1500,7 @@ void EnBigslime_SetupCutsceneGrabPlayer(EnBigslime* this, PlayState* play) {
this->grabPlayerTimer = 15;
this->wavySurfaceTimer = 0;
this->bigslimeCollider[0].base.atFlags &= ~AT_ON;
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
yaw = Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.world.rot.y;
if (yaw > 0x4000) {
@ -2056,8 +2056,8 @@ void EnBigslime_JumpGekko(EnBigslime* this, PlayState* play) {
}
if (Math_SmoothStepToS(&this->actor.world.rot.y, this->gekkoYaw, 5, 0x1000, 0x80) == 0) {
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 240.0f) {
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 240.0f) {
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
yawDiff = yaw - (s16)(this->actor.yawTowardsPlayer + 0x8000);
this->gekkoYaw =
ABS_ALT(yawDiff) < 0x3000 ? yaw : (yawDiff / 2) + (s16)(this->actor.yawTowardsPlayer + 0x8000);
@ -2088,7 +2088,7 @@ void EnBigslime_SetupIdleLookAround(EnBigslime* this) {
Animation_PlayOnce(&this->skelAnime, &gGekkoNervousIdleAnim);
this->idleTimer = 60;
this->actor.speedXZ = 0.0f;
if (BINANG_SUB(Actor_YawToPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) {
if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) {
this->gekkoYaw = this->gekkoRot.y + (Rand_Next() >> 20) + 0x2000;
} else {
this->gekkoYaw = this->gekkoRot.y - (Rand_Next() >> 20) - 0x2000;
@ -2110,7 +2110,7 @@ void EnBigslime_IdleLookAround(EnBigslime* this, PlayState* play) {
if ((this->skelAnime.animation == &gGekkoNervousIdleAnim) &&
Math_ScaledStepToS(&this->gekkoRot.y, this->gekkoYaw, 0x400)) {
if (BINANG_SUB(Actor_YawToPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) {
if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->gekkoRot.y) > 0) {
this->gekkoYaw = this->gekkoRot.y + (Rand_Next() >> 20) + 0x2000;
} else {
this->gekkoYaw = this->gekkoRot.y - (Rand_Next() >> 20) - 0x2000;
@ -2224,8 +2224,8 @@ void EnBigslime_StunGekko(EnBigslime* this, PlayState* play) {
void EnBigslime_SetupCutsceneFormBigslime(EnBigslime* this) {
Animation_PlayOnce(&this->skelAnime, &gGekkoJumpUpAnim);
this->gekkoCollider.base.acFlags &= ~AC_ON;
this->actor.world.rot.x = -Actor_PitchToPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actionFunc = EnBigslime_CutsceneFormBigslime;
this->actor.speedXZ = 0.0f;
}
@ -2334,7 +2334,7 @@ void EnBigslime_SetupCutsceneDefeat(EnBigslime* this, PlayState* play) {
subCamAt.y = this->actor.world.pos.y + 40.0f;
subCamAt.z = this->actor.world.pos.z;
if (BINANG_SUB(Actor_YawToPoint(&this->actor, &this->actor.home.pos), this->actor.world.rot.y) > 0) {
if (BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), this->actor.world.rot.y) > 0) {
yawOffset = this->actor.world.rot.y + 0x4000;
} else {
yawOffset = this->actor.world.rot.y - 0x4000;

View File

@ -177,9 +177,9 @@ void func_808A2918(EnBoom* this, PlayState* play) {
sp7C = this->player;
if (sp7C != NULL) {
sp72 = Actor_YawToPoint(&this->actor, &sp7C->focus.pos);
sp72 = Actor_WorldYawTowardPoint(&this->actor, &sp7C->focus.pos);
sp70 = this->actor.world.rot.y - sp72;
sp6E = Actor_PitchToPoint(&this->actor, &sp7C->focus.pos);
sp6E = Actor_WorldPitchTowardPoint(&this->actor, &sp7C->focus.pos);
sp6C = this->actor.world.rot.x - sp6E;
sp64 = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &sp7C->focus.pos)) * 0.005f;

View File

@ -168,7 +168,7 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
if ((this->actor.parent != NULL) && (this->actor.parent->home.rot.z == 0)) {
this->actor.home.pos.x = this->actor.parent->world.pos.x;
this->actor.home.pos.z = this->actor.parent->world.pos.z;
dist = Actor_XZDistanceToPoint(&this->actor, &this->actor.parent->world.pos);
dist = Actor_WorldDistXZToPoint(&this->actor, &this->actor.parent->world.pos);
} else {
dist = 450.0f;
this->actor.flags |= ACTOR_FLAG_1;
@ -176,14 +176,14 @@ void EnCrow_FlyIdle(EnCrow* this, PlayState* play) {
if (this->actor.bgCheckFlags & 8) {
this->yawTarget = this->actor.wallYaw;
} else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->yawTarget = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->yawTarget = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->yawTarget, 5, 0x300, 0x10) == 0) && onInitialAnimFrame &&
(Rand_ZeroOne() < 0.1f)) {
yaw = (Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y);
yaw = (Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y);
if (yaw > 0) {
this->yawTarget += Rand_S16Offset(0x1000, 0x1000);
} else {
@ -258,16 +258,16 @@ void EnCrow_DiveAttack(EnCrow* this, PlayState* play) {
}
targetPos.x = this->actor.child->world.pos.x;
targetPos.z = this->actor.child->world.pos.z;
pitchTarget = Actor_PitchToPoint(&this->actor, &targetPos);
pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &targetPos);
pitchTarget = CLAMP(pitchTarget, -0x3000, 0x3000);
Math_SmoothStepToS(&this->actor.shape.rot.x, pitchTarget, 2, 0x400, 0x40);
} else {
Math_SmoothStepToS(&this->actor.shape.rot.x, -0x800, 2, 0x100, 0x10);
}
if (isFacingActor || (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) > 80.0f)) {
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->actor.child), 4, 0xC00,
0xC0);
if (isFacingActor || (Actor_WorldDistXZToActor(&this->actor, this->actor.child) > 80.0f)) {
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->actor.child), 4,
0xC00, 0xC0);
}
if (((this->timer == 0) || ((&player->actor != this->actor.child) && (this->actor.child->home.rot.z != 0)) ||

View File

@ -299,7 +299,7 @@ void func_808BDA4C(EnDekunuts* this, PlayState* play) {
sp58.x = player->actor.world.pos.x;
sp58.z = player->actor.world.pos.z;
sp58.y = player->actor.world.pos.y + 40.0f;
pitch = Actor_PitchToPoint(&this->actor, &sp58);
pitch = Actor_WorldPitchTowardPoint(&this->actor, &sp58);
pitch = CLAMP(pitch, -0x3800, -0x2000);
if (this->skelAnime.curFrame < 7.0f) {
Math_ScaledStepToS(&this->actor.world.rot.x, pitch, 0x800);
@ -414,11 +414,11 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) {
Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f);
if (!Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_192, 1, 0xE38, 0xB6)) {
if (this->actor.bgCheckFlags & 0x20) {
this->unk_192 = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
} else if (this->actor.bgCheckFlags & 8) {
this->unk_192 = this->actor.wallYaw;
} else if (this->unk_18D == 0) {
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
yaw2 = yaw - this->actor.yawTowardsPlayer;
if (ABS_ALT(yaw2) > 0x2000) {
this->unk_192 = yaw;
@ -431,7 +431,7 @@ void func_808BDFB8(EnDekunuts* this, PlayState* play) {
}
this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y);
if ((this->unk_18D == 0) && (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 20.0f) &&
if ((this->unk_18D == 0) && (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f) &&
(fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f)) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.flags &= ~ACTOR_FLAG_20;

View File

@ -415,7 +415,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) {
temp_v0 = func_800BC270(play, &this->actor, 80.0f, 0x138B0);
if (temp_v0 != NULL) {
temp_v1 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E;
temp_v1 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E;
if (ABS_ALT(temp_v1) < 0x3000) {
func_8089D11C(this, temp_v1 + this->unk_28E);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU);
@ -425,7 +425,7 @@ s32 func_8089AE00(EnDinofos* this, PlayState* play) {
temp_v0 = func_800BC444(play, &this->actor, 80.0f);
if ((temp_v0 != NULL) && (temp_v0->id == ACTOR_EN_BOM_CHU)) {
temp_v1_2 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E;
temp_v1_2 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_28E;
if (ABS_ALT(temp_v1_2) < 0x3000) {
func_8089C024(this, 1);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WARAU);

View File

@ -311,7 +311,7 @@ void func_80A71B68(EnDno* this, PlayState* play) {
if (!(this->unk_3B0 & 0x20)) {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_PRAYER_LOOP,
&this->animIndex);
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->unk_460);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->unk_460);
}
} else {
SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, EN_DNO_ANIM_IDLE, &this->animIndex);
@ -347,8 +347,8 @@ void func_80A71C3C(EnDno* this, PlayState* play) {
}
case EN_DNO_ANIM_PRAYER_LOOP:
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, this->unk_460), 2, 0xE38,
0x222);
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->unk_460), 2,
0xE38, 0x222);
break;
}
@ -436,7 +436,7 @@ void func_80A71F18(EnDno* this, PlayState* play) {
&this->animIndex);
}
Math_ScaledStepToS(&this->actor.shape.rot.y,
Actor_YawBetweenActors(&this->actor, this->unk_460), 0x71C);
Actor_WorldYawTowardActor(&this->actor, this->unk_460), 0x71C);
break;
case EN_DNO_ANIM_IMPLORE_END:

View File

@ -592,9 +592,10 @@ void func_80877500(EnDodongo* this, PlayState* play) {
}
}
} else {
if ((Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 150.0f) ||
if ((Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 150.0f) ||
(Player_GetMask(play) == PLAYER_MASK_STONE)) {
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x1F4);
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
0x1F4);
}
this->timer--;

View File

@ -457,7 +457,7 @@ void func_80866A5C(EnDoor* this, PlayState* play) {
this->unk_1A6 = 10;
}
} else if ((this->unk_1A4 == 4) &&
(Actor_XZDistanceBetweenActors(&this->dyna.actor, &GET_PLAYER(play)->actor) > 120.0f)) {
(Actor_WorldDistXZToActor(&this->dyna.actor, &GET_PLAYER(play)->actor) > 120.0f)) {
this->actionFunc = func_8086704C;
this->dyna.actor.world.rot.y = -0x1800;
}

View File

@ -798,7 +798,7 @@ void EnFall_LodMoon_DrawWithoutLerp(Actor* thisx, PlayState* play) {
* to be 9000 units away before drawing it.
*/
void EnFall_LodMoon_DrawWithLerp(Actor* thisx, PlayState* play) {
f32 distanceToEye = Actor_DistanceToPoint(thisx, &play->view.eye);
f32 distanceToEye = Actor_WorldDistXYZToPoint(thisx, &play->view.eye);
f32 scale;
Vec3f translation;

View File

@ -273,7 +273,7 @@ void EnFamos_SetupDeathDebris(EnFamos* this) {
s32 EnFamos_IsPlayerSeen(EnFamos* this, PlayState* play) {
if ((Player_GetMask(play) != PLAYER_MASK_STONE) &&
(Actor_XZDistanceToPoint(&GET_PLAYER(play)->actor, &this->calmPos) < this->aggroDistance) &&
(Actor_WorldDistXZToPoint(&GET_PLAYER(play)->actor, &this->calmPos) < this->aggroDistance) &&
Actor_IsFacingPlayer(&this->actor, 0x5000)) {
return true;
} else {
@ -374,7 +374,7 @@ void EnFamos_SetupPathingIdle(EnFamos* this) {
}
Math_Vec3s_ToVec3f(&this->targetDest, &this->pathPoints[this->currentPathNode]);
this->targetYaw = Actor_YawToPoint(&this->actor, &this->targetDest);
this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest);
this->actionFunc = EnFamos_PathingIdle;
this->actor.speedXZ = 0.0f;
}
@ -396,7 +396,7 @@ void EnFamos_PathingIdle(EnFamos* this, PlayState* play) {
* Famos lost player; Turning to face back toward home.
*/
void EnFamos_SetupTurnHome(EnFamos* this) {
this->targetYaw = Actor_YawToPoint(&this->actor, &this->calmPos);
this->targetYaw = Actor_WorldYawTowardPoint(&this->actor, &this->calmPos);
Math_Vec3f_Copy(&this->targetDest, &this->calmPos);
this->actionFunc = EnFamos_TurnHome;
this->actor.speedXZ = 0.0f;
@ -416,14 +416,14 @@ void EnFamos_TurnHome(EnFamos* this, PlayState* play) {
*/
void EnFamos_SetupReturnHome(EnFamos* this) {
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.x = -Actor_PitchToPoint(&this->actor, &this->targetDest);
this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &this->targetDest);
this->actionFunc = EnFamos_ReturnHome;
}
void EnFamos_ReturnHome(EnFamos* this, PlayState* play) {
f32 distanceToHome = Actor_XZDistanceToPoint(&this->actor, &this->targetDest);
f32 distanceToHome = Actor_WorldDistXZToPoint(&this->actor, &this->targetDest);
this->actor.shape.rot.y = Actor_YawToPoint(&this->actor, &this->targetDest);
this->actor.shape.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->targetDest);
this->actor.world.rot.y = this->actor.shape.rot.y;
EnFamos_UpdateBobbingHeight(this);
if (this->isCalm) {
@ -497,7 +497,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) {
abovePlayerPos.x = player->actor.world.pos.x;
abovePlayerPos.y = player->actor.world.pos.y + 100.0f;
abovePlayerPos.z = player->actor.world.pos.z;
this->actor.world.rot.x = -Actor_PitchToPoint(&this->actor, &abovePlayerPos);
this->actor.world.rot.x = -Actor_WorldPitchTowardPoint(&this->actor, &abovePlayerPos);
Math_StepToF(&this->actor.speedXZ, 6.0f, 0.5f);
surfaceType = func_800C9B18(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId);
@ -506,7 +506,7 @@ void EnFamos_Chase(EnFamos* this, PlayState* play) {
EnFamos_SetupAttackAim(this);
} else if ((Player_GetMask(play) == PLAYER_MASK_STONE) ||
(this->aggroDistance < Actor_XZDistanceToPoint(&GET_PLAYER(play)->actor, &this->calmPos)) ||
(this->aggroDistance < Actor_WorldDistXZToPoint(&GET_PLAYER(play)->actor, &this->calmPos)) ||
!Actor_IsFacingPlayer(&this->actor, 0x6000)) {
EnFamos_SetupScanForPlayer(this);
}

View File

@ -208,8 +208,8 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) {
return false;
}
if (Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos) > 300.0f) {
distFromHome = Actor_DistanceToPoint(&this->actor, &this->actor.home.pos);
if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 300.0f) {
distFromHome = Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos);
if (distFromHome < 5.0f) {
EnFirefly_SetupPerch(this);
@ -218,9 +218,10 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, PlayState* play) {
this->actor.speedXZ *= distFromHome * 0.05f;
}
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
0x300);
Math_ScaledStepToS(&this->actor.shape.rot.x,
Actor_PitchToPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100);
Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100);
}
return true;
@ -242,7 +243,7 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) {
while (findTorch != NULL) {
if ((findTorch->actor.id == ACTOR_OBJ_SYOKUDAI) && (findTorch->snuffTimer != OBJ_SYOKUDAI_SNUFF_OUT)) {
currentDist = Actor_DistanceBetweenActors(&this->actor, &findTorch->actor);
currentDist = Actor_WorldDistXYZToActor(&this->actor, &findTorch->actor);
if (currentDist < currentMinDist) {
currentMinDist = currentDist;
closestTorch = findTorch;
@ -256,12 +257,13 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) {
flamePos.y = closestTorch->actor.world.pos.y + 52.0f + 30.0f;
flamePos.z = closestTorch->actor.world.pos.z;
if (Actor_DistanceToPoint(&this->actor, &flamePos) < 15.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &flamePos) < 15.0f) {
EnFirefly_Ignite(this);
} else {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &closestTorch->actor),
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &closestTorch->actor),
0x300);
Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &flamePos) + 0x1554, 0x100);
Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &flamePos) + 0x1554,
0x100);
}
return true;
@ -273,7 +275,7 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, PlayState* play) {
void EnFirefly_SetupFlyIdle(EnFirefly* this) {
this->timer = Rand_S16Offset(70, 100);
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f;
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300);
this->pitchTarget = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554;
this->skelAnime.playSpeed = 1.0f;
this->actionFunc = EnFirefly_FlyIdle;
@ -296,8 +298,8 @@ void EnFirefly_FlyIdle(EnFirefly* this, PlayState* play) {
rand = Rand_ZeroOne();
if (rand < 0.5f) {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos),
0x300);
Math_ScaledStepToS(&this->actor.shape.rot.y,
Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300);
} else if (rand < 0.8f) {
this->actor.shape.rot.y += (s16)randPlusMinusPoint5Scaled(1536.0f);
}
@ -447,8 +449,8 @@ void EnFirefly_DiveAttack(EnFirefly* this, PlayState* play) {
preyPos.x = player->actor.world.pos.x;
preyPos.y = player->actor.world.pos.y + 20.0f;
preyPos.z = player->actor.world.pos.z;
Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &preyPos) + 0x1554, 2, 0x400,
0x100);
Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, 2,
0x400, 0x100);
} else {
this->skelAnime.playSpeed = 1.5f;
if (this->actor.xzDistToPlayer > 80.0f) {
@ -532,7 +534,8 @@ void EnFirefly_FlyAway(EnFirefly* this, PlayState* play) {
if (this->actor.bgCheckFlags & 8) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300);
} else {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x300);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
0x300);
}
Math_ScaledStepToS(&this->actor.shape.rot.x, this->pitchTarget, 0x100);
@ -627,7 +630,8 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, PlayState* play) {
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_PitchToPoint(&this->actor, &preyPos) + 0x1554, 0x100);
Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554,
0x100);
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x300);
}

View File

@ -651,9 +651,9 @@ void func_808D1D6C(EnFloormas* this, PlayState* play) {
return;
}
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, sp2C), 0x38E);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, sp2C), 0x38E);
if (Actor_XZDistanceBetweenActors(&this->actor, sp2C) < 80.0f) {
if (Actor_WorldDistXZToActor(&this->actor, sp2C) < 80.0f) {
func_808D2484(this);
}
} else {
@ -794,7 +794,7 @@ void func_808D24F0(EnFloormas* this, PlayState* play) {
this->actor.speedXZ = 5.0f;
this->actor.velocity.y = 7.0f;
} else if (this->skelAnime.curFrame < 20.0f) {
Math_ApproachS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, phi_s1), 2, 0xE38);
Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, phi_s1), 2, 0xE38);
} else if (((phi_s1->world.pos.y - this->actor.world.pos.y) < -10.0f) &&
(fabsf(this->actor.world.pos.x - phi_s1->world.pos.x) < 10.0f) &&
(fabsf(this->actor.world.pos.z - phi_s1->world.pos.z) < 10.0f)) {

View File

@ -430,7 +430,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) {
return;
}
sp4A = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
sp4A = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
if ((fabsf(Math_SinS(sp4A)) < 0.9f) && (Math_CosS(sp4A) > 0.0f)) {
if (this->actor.speedXZ < this->unk_398) {
@ -455,7 +455,7 @@ void func_8087B7C0(EnHorse* this, PlayState* play, Path* path) {
}
this->unk_394 |= 1;
} else if ((sp68 + 1) == this->curRaceWaypoint) {
s16 sp48 = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
s16 sp48 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
if ((fabsf(Math_SinS(sp48)) < 0.9f) && (Math_CosS(sp48) > 0.0f)) {
if (this->actor.speedXZ < this->unk_398) {
@ -622,7 +622,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
this->actor.world.pos.z = spawnPos.z;
this->actor.prevPos = this->actor.world.pos;
this->actor.world.rot.y = 0;
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
spawn = true;
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &this->actor.projectedPos,
&this->actor.projectedW);
@ -648,7 +648,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
this->actor.world.pos.z = spawnPos.z;
this->actor.prevPos = this->actor.world.pos;
this->actor.world.rot.y = 0;
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
spawn = true;
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos, &this->actor.projectedPos,
&this->actor.projectedW);
@ -2026,7 +2026,7 @@ void EnHorse_StartMovingAnimation(EnHorse* this, s32 anim, f32 morphFrames, f32
void EnHorse_SetFollowAnimation(EnHorse* this, PlayState* play) {
s32 anim = ENHORSE_ANIM_WALK;
f32 distToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
f32 distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor);
if (distToPlayer > 400.0f) {
anim = ENHORSE_ANIM_GALLOP;
@ -2063,7 +2063,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) {
f32 distToPlayer;
D_801BDAA4 = 0;
distToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor);
if (((this->playerDir == PLAYER_DIR_BACK_R) || (this->playerDir == PLAYER_DIR_BACK_L)) && (distToPlayer > 300.0f) &&
!(this->stateFlags & ENHORSE_TURNING_TO_PLAYER)) {
@ -2071,7 +2071,7 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) {
this->animIndex = ENHORSE_ANIM_REARING;
this->stateFlags |= ENHORSE_TURNING_TO_PLAYER;
this->angleToPlayer = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
this->angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
angleDiff = (f32)this->angleToPlayer - this->actor.world.rot.y;
if (angleDiff > 0x7FFF) {
@ -3032,7 +3032,7 @@ void EnHorse_FleePlayer(EnHorse* this, PlayState* play) {
(nextAnimIndex == ENHORSE_ANIM_WALK)) {
if (playerDistToHome < 300.0f) {
yaw = player->actor.shape.rot.y;
yaw += ((Actor_YawBetweenActors(&this->actor, &player->actor) > 0) ? 1 : -1) * 0x3FFF;
yaw += ((Actor_WorldYawTowardActor(&this->actor, &player->actor) > 0) ? 1 : -1) * 0x3FFF;
} else {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos) - this->actor.world.rot.y;
}
@ -4069,7 +4069,7 @@ void EnHorse_RegenBoost(EnHorse* this, PlayState* play) {
void EnHorse_UpdatePlayerDir(EnHorse* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s16 angle = Actor_YawBetweenActors(&this->actor, &player->actor) - this->actor.world.rot.y;
s16 angle = Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.world.rot.y;
f32 s = Math_SinS(angle);
f32 c = Math_CosS(angle);
@ -4399,7 +4399,7 @@ s32 EnHorse_PlayerDirToMountSide(EnHorse* this, PlayState* play, Player* player)
s32 EnHorse_MountSideCheck(EnHorse* this, PlayState* play, Player* player) {
s32 mountSide;
if (Actor_XZDistanceBetweenActors(&this->actor, &player->actor) > 75.0f) {
if (Actor_WorldDistXZToActor(&this->actor, &player->actor) > 75.0f) {
return 0;
}
@ -4407,7 +4407,7 @@ s32 EnHorse_MountSideCheck(EnHorse* this, PlayState* play, Player* player) {
return 0;
}
if (Math_CosS(Actor_YawBetweenActors(&player->actor, &this->actor) - player->actor.world.rot.y) <
if (Math_CosS(Actor_WorldYawTowardActor(&player->actor, &this->actor) - player->actor.world.rot.y) <
0.17364818f) { // cos(80 degrees)
return 0;
}

View File

@ -208,7 +208,7 @@ void func_808DEA54(EnHorseLinkChild* this, s32 arg1) {
}
void func_808DEB14(EnHorseLinkChild* this, PlayState* play) {
f32 sp44 = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
f32 sp44 = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor);
s32 phi_v0;
if (SkelAnime_Update(&this->skin.skelAnime)) {
@ -248,7 +248,7 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) {
s32 phi_v0;
if ((this->unk_148 == 4) || (this->unk_148 == 3) || (this->unk_148 == 2)) {
temp_a0 = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
temp_a0 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
if (temp_a0 > 0x12C) {
this->actor.world.rot.y += 0x12C;
} else if (temp_a0 < -0x12C) {
@ -260,7 +260,7 @@ void func_808DED40(EnHorseLinkChild* this, PlayState* play) {
}
if (SkelAnime_Update(&this->skin.skelAnime)) {
temp_fv0 = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
temp_fv0 = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor);
if (temp_fv0 > 1000.0f) {
func_808DEA54(this, 0);
return;
@ -309,7 +309,7 @@ void func_808DF088(EnHorseLinkChild* this, PlayState* play) {
if (Math3D_Distance(&player->actor.world.pos, &this->actor.home.pos) < 250.0f) {
sp32 = player->actor.shape.rot.y;
if (Actor_YawBetweenActors(&this->actor, &player->actor) > 0) {
if (Actor_WorldYawTowardActor(&this->actor, &player->actor) > 0) {
phi_v0 = 1;
} else {
phi_v0 = -1;
@ -340,7 +340,7 @@ void func_808DF194(EnHorseLinkChild* this, PlayState* play) {
func_808DF088(this, play);
player = GET_PLAYER(play);
sp50 = Actor_XZDistanceBetweenActors(&this->actor, &player->actor);
sp50 = Actor_WorldDistXZToActor(&this->actor, &player->actor);
sp48 = this->unk_148;
sp4C = SkelAnime_Update(&this->skin.skelAnime);
@ -433,7 +433,7 @@ void func_808DF620(EnHorseLinkChild* this, PlayState* play) {
}
this->actor.speedXZ = 0.0f;
sp36 = Actor_YawBetweenActors(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
sp36 = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
if ((Math_CosS(sp36) < 0.7071f) && (this->unk_148 == 2)) {
func_800F415C(&this->actor, &GET_PLAYER(play)->actor.world.pos, 0x12C);
@ -480,7 +480,7 @@ void func_808DF838(EnHorseLinkChild* this, PlayState* play) {
if (SkelAnime_Update(&this->skin.skelAnime)) {
if (this->unk_1E0 == 0) {
phi_fv0 = Actor_XZDistanceBetweenActors(&this->actor, &GET_PLAYER(play)->actor);
phi_fv0 = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor);
} else {
phi_fv0 = Math3D_Distance(&this->actor.world.pos, &this->actor.home.pos);
}

View File

@ -3608,7 +3608,7 @@ void func_80B4B768(EnInvadepoh* this, PlayState* play) {
s32 pad;
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
Math_SmoothStepToS(&this->actor.world.rot.y, Actor_YawBetweenActors(&this->actor, &D_80B5040C->actor), 5, 0x1388,
Math_SmoothStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardActor(&this->actor, &D_80B5040C->actor), 5, 0x1388,
0x64);
func_80B44E90(this, play);
if (Animation_OnFrame(&this->skelAnime, 13.0f) || Animation_OnFrame(&this->skelAnime, 19.0f)) {

View File

@ -395,7 +395,7 @@ s32 func_80B85A00(EnKaizoku* this, PlayState* play, s16 arg2) {
if (((this->picto.actor.bgCheckFlags & 8) && (sp32 < 0x2EE0)) || (explosiveActor->id == ACTOR_EN_BOM_CHU)) {
if ((explosiveActor->id == ACTOR_EN_BOM_CHU) &&
(Actor_DistanceBetweenActors(&this->picto.actor, explosiveActor) < 80.0f) &&
(Actor_WorldDistXYZToActor(&this->picto.actor, explosiveActor) < 80.0f) &&
(BINANG_ADD(this->picto.actor.shape.rot.y - explosiveActor->world.rot.y, 0x8000) < 0x4000)) {
if (this->action != KAIZOKU_ACTION_6) {
func_80B87C7C(this);

View File

@ -229,8 +229,8 @@ void func_80AD7254(EnKame* this, PlayState* play) {
if (this->unk_2A4 != this->actor.shape.rot.y) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->unk_2A4, 0x100);
this->actor.world.rot.y = this->actor.shape.rot.y;
} else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 40.0f) {
this->unk_2A4 = Actor_YawToPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14);
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 40.0f) {
this->unk_2A4 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14);
}
this->unk_29E--;
@ -316,7 +316,7 @@ void func_80AD76CC(EnKame* this) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_CUTTER_ON);
this->unk_2BC.y = this->actor.home.pos.y - 100.0f;
} else {
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
Math_Vec3f_Copy(&this->unk_2BC, &this->actor.home.pos);
this->unk_29E = 0;
}
@ -363,12 +363,12 @@ void func_80AD7948(EnKame* this, PlayState* play) {
func_80AD75A8(this, play);
if (this->unk_29E == -1) {
s16 temp_v0 = Actor_YawToPoint(&this->actor, &this->unk_2BC) - this->actor.world.rot.y;
s16 temp_v0 = Actor_WorldYawTowardPoint(&this->actor, &this->unk_2BC) - this->actor.world.rot.y;
temp_v1 = ABS_ALT(temp_v0);
if ((this->actor.bgCheckFlags & 8) || (temp_v1 > 0x3000) ||
(Actor_XZDistanceToPoint(&this->actor, &this->unk_2BC) < 50.0f)) {
(Actor_WorldDistXZToPoint(&this->actor, &this->unk_2BC) < 50.0f)) {
s8 pad;
if (this->unk_2BC.y < this->actor.home.pos.y) {
@ -706,7 +706,7 @@ void EnKame_Update(Actor* thisx, PlayState* play) {
if ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.atFlags & AT_BOUNCED)) {
this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT);
func_80AD76CC(this);
if (Actor_XZDistanceToPoint(&this->actor, &this->unk_2BC) < 50.0f) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->unk_2BC) < 50.0f) {
this->collider.base.atFlags &= ~AT_ON;
}
this->unk_2A6 = 0x3B00;

View File

@ -701,7 +701,7 @@ void func_80A5CB74(EnKusa2* this) {
sp3E = Rand_S16Offset(-10000, 20000) + this->actor.world.rot.y;
if (this->unk_1C0 != NULL) {
sp36 = Actor_YawBetweenActors(&this->actor, &this->unk_1C0->actor);
sp36 = Actor_WorldYawTowardActor(&this->actor, &this->unk_1C0->actor);
sp3C = Rand_S16Offset(-4000, 8000) + sp36;
} else {
sp3C = 0;
@ -976,7 +976,7 @@ void func_80A5D7C4(EnKusa2* this, PlayState* play) {
if ((this->unk_1C0 != NULL) && (this->unk_1C0->unk_1BE != 0)) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
if (this2->unk_1C0 != NULL) {
sp2A = Actor_YawBetweenActors(&this->unk_1C0->actor, &this->actor);
sp2A = Actor_WorldYawTowardActor(&this->unk_1C0->actor, &this->actor);
this->actor.home.rot.y = Rand_S16Offset(-1500, 3000) + sp2A;
}
this->unk_1C8 = Rand_S16Offset(72, 16);

View File

@ -338,7 +338,7 @@ void EnMinifrog_SetupNextFrogInit(EnMinifrog* this, PlayState* play) {
missingFrog = nextFrog->frog;
if (nextFrog->frog != NULL) {
this->actor.home.rot.y =
(s16)Actor_YawBetweenActors(&this->actor, &missingFrog->actor); // Set home to missing frog
(s16)Actor_WorldYawTowardActor(&this->actor, &missingFrog->actor); // Set home to missing frog
EnMinifrog_TurnToMissingFrog(this);
} else {
EnMinifrog_TurnToPlayer(this);
@ -427,7 +427,7 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, PlayState* play) {
this->actor.home.rot.z = 0;
this->actionFunc = EnMinifrog_NextFrogMissing;
this->timer = 60;
this->actor.home.rot.y = Actor_YawBetweenActors(&this->actor, &this->frog->actor);
this->actor.home.rot.y = Actor_WorldYawTowardActor(&this->actor, &this->frog->actor);
func_801A1F88();
this->flags &= ~0x100;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |

View File

@ -246,8 +246,8 @@ void EnMinislime_SetupFall(EnMinislime* this, PlayState* play) {
this->actor.scale.x = 0.095f;
this->actor.scale.z = 0.095f;
this->actor.scale.y = 0.10700001f;
if (Actor_XZDistanceBetweenActors(&this->actor, &player->actor) < 225.0f) {
yaw = Actor_YawBetweenActors(&player->actor, &this->actor);
if (Actor_WorldDistXZToActor(&this->actor, &player->actor) < 225.0f) {
yaw = Actor_WorldYawTowardActor(&player->actor, &this->actor);
this->actor.world.pos.x = Math_SinS(yaw) * 225.0f + player->actor.world.pos.x;
this->actor.world.pos.z = Math_CosS(yaw) * 225.0f + player->actor.world.pos.z;
}
@ -267,7 +267,7 @@ void EnMinislime_Fall(EnMinislime* this, PlayState* play) {
void EnMinislime_SetupBreakFromBigslime(EnMinislime* this) {
f32 velY;
this->actor.world.rot.y = Actor_YawBetweenActors(this->actor.parent, &this->actor);
this->actor.world.rot.y = Actor_WorldYawTowardActor(this->actor.parent, &this->actor);
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.speedXZ = Math_CosS(this->actor.world.rot.x) * 15.0f;
velY = Math_SinS(this->actor.world.rot.x) * 15.0f;
@ -434,8 +434,8 @@ void EnMinislime_Idle(EnMinislime* this, PlayState* play) {
if (this->actor.xzDistToPlayer < 300.0f) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
} else {
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 200.0f) {
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 200.0f) {
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
} else {
this->actor.world.rot.y += (s16)((s32)Rand_Next() >> 0x13);
}
@ -491,8 +491,8 @@ void EnMinislime_Bounce(EnMinislime* this, PlayState* play) {
void EnMinislime_SetupMoveToBigslime(EnMinislime* this) {
this->actor.gravity = 0.0f;
this->actor.speedXZ = 15.0f;
this->actor.shape.rot.x = Actor_PitchToPoint(&this->actor, &this->actor.parent->home.pos);
this->actor.shape.rot.y = Actor_YawToPoint(&this->actor, &this->actor.parent->home.pos);
this->actor.shape.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &this->actor.parent->home.pos);
this->actor.shape.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.parent->home.pos);
this->actor.world.rot.x = -this->actor.shape.rot.x;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->collider.base.atFlags &= ~AT_ON;

View File

@ -267,7 +267,7 @@ void func_80A4E2E8(EnMkk* this, PlayState* play) {
sp20 = Math_StepToF(&this->actor.speedXZ, 0.0f, 0.7f);
}
if ((player->stateFlags3 & 0x100) || (Player_GetMask(play) == PLAYER_MASK_STONE)) {
Math_ScaledStepToS(&this->unk_150, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x400);
Math_ScaledStepToS(&this->unk_150, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x400);
} else if ((player->stateFlags2 & 0x80) || (player->actor.freezeTimer > 0)) {
Math_ScaledStepToS(&this->unk_150, this->actor.yawTowardsPlayer + 0x8000, 0x400);
} else {
@ -421,7 +421,7 @@ void EnMkk_Update(Actor* thisx, PlayState* play) {
}
if (Actor_IsFacingPlayer(&this->actor, 0x3000)) {
player = GET_PLAYER(play);
this->actor.shape.rot.x = Actor_PitchToPoint(&this->actor, &player->actor.focus.pos);
this->actor.shape.rot.x = Actor_WorldPitchTowardPoint(&this->actor, &player->actor.focus.pos);
this->actor.shape.rot.x = CLAMP(this->actor.shape.rot.x, -0x1800, 0x1800);
}
Actor_SetFocus(&this->actor, 10.0f);

View File

@ -171,7 +171,7 @@ void EnNeoReeba_WaitUnderground(EnNeoReeba* this, PlayState* play) {
s32 pad;
Player* player = GET_PLAYER(play);
if ((Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos) < 200.0f) &&
if ((Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) < 200.0f) &&
(Player_GetMask(play) != PLAYER_MASK_STONE) && (fabsf(this->actor.playerHeightRel) < 100.0f)) {
EnNeoReeba_SetupRise(this);
}
@ -199,7 +199,7 @@ void EnNeoReeba_SetupChooseAction(EnNeoReeba* this) {
void EnNeoReeba_ChooseAction(EnNeoReeba* this, PlayState* play) {
Player* player = GET_PLAYER(play);
f32 distToPlayer = Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos);
f32 distToPlayer = Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos);
if ((distToPlayer > 200.0f) || (fabsf(this->actor.playerHeightRel) > 100.0f)) {
EnNeoReeba_SetupSink(this);
@ -318,7 +318,7 @@ void EnNeoReeba_ReturnHome(EnNeoReeba* this, PlayState* play) {
this->actor.speedXZ -= 1.0f;
}
if (Actor_XZDistanceToPoint(&player->actor, &this->actor.home.pos) > 200.0f ||
if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 200.0f ||
fabsf(this->actor.playerHeightRel) > 100.0f) {
EnNeoReeba_SetupSink(this);
}

View File

@ -327,8 +327,8 @@ void func_80B5BE88(EnOt* this, PlayState* play) {
void func_80B5BED4(EnOt* this, PlayState* play) {
func_800BE33C(&this->actor.world.pos, &this->unk_360->actor.world.pos, &this->actor.world.rot, 0);
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &this->unk_360->actor), 3, 0xE38,
0x38E);
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor), 3,
0xE38, 0x38E);
this->actor.speedXZ = 3.5f;
this->actor.world.pos.y = this->unk_360->actor.world.pos.y;
Actor_MoveWithoutGravityReverse(&this->actor);
@ -348,10 +348,10 @@ void func_80B5BFB8(EnOt* this, PlayState* play) {
Math_StepToF(&this->actor.world.pos.y, temp_f0, 2.0f);
}
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &this->unk_360->actor), 3, 0xE38,
0x38E);
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor), 3,
0xE38, 0x38E);
if (Actor_DistanceBetweenActors(&this->actor, &this->unk_360->actor) <= 52.519997f) {
if (Actor_WorldDistXYZToActor(&this->actor, &this->unk_360->actor) <= 52.519997f) {
this->unk_73C = 50;
Matrix_RotateYS(this->actor.world.rot.y, MTXMODE_NEW);
Matrix_MultVecZ(52.519997f, &sp34);
@ -400,7 +400,7 @@ void func_80B5C244(EnOt* this, PlayState* play) {
}
void func_80B5C25C(EnOt* this, PlayState* play) {
this->unk_390 = Actor_YawBetweenActors(&this->actor, &this->unk_360->actor);
this->unk_390 = Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_390, 3, 0xE38, 0x38E);
if (BINANG_SUB(BINANG_ROT180(this->unk_360->actor.shape.rot.y), this->actor.shape.rot.y) < 0x38E) {
this->unk_32C |= 0x80;
@ -449,7 +449,7 @@ void func_80B5C3D8(EnOt* this, PlayState* play) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_348);
Math_Vec3f_Copy(&this->unk_360->actor.world.pos, &this->unk_360->unk_348);
temp = Actor_YawBetweenActors(&this->actor, &this->unk_360->actor);
temp = Actor_WorldYawTowardActor(&this->actor, &this->unk_360->actor);
this->actor.shape.rot.y = temp;
this->unk_360->actor.shape.rot.y = BINANG_ROT180(temp);
@ -498,7 +498,7 @@ void func_80B5C6DC(EnOt* this, PlayState* play) {
s16 sp3E;
Vec3f sp30;
sp3E = Actor_YawToPoint(&player->actor, &this->unk_394);
sp3E = Actor_WorldYawTowardPoint(&player->actor, &this->unk_394);
Matrix_RotateYS(BINANG_ADD(sp3E, 0x4000), MTXMODE_NEW);
if (this->unk_33C == 2) {
Matrix_MultVecZ(26.259998f, &sp30);

View File

@ -447,7 +447,7 @@ void EnPametfrog_RearOnSnapper(EnPametfrog* this, PlayState* play) {
rearingPoint.x = this->actor.world.pos.x;
rearingPoint.y = this->actor.world.pos.y + 10.0f;
rearingPoint.z = this->actor.world.pos.z;
if (actor->world.rot.x < Actor_PitchToPoint(actor, &rearingPoint)) {
if (actor->world.rot.x < Actor_WorldPitchTowardPoint(actor, &rearingPoint)) {
EnPametfrog_SetupRearOnSnapperWave(this);
} else {
EnPametfrog_SetupRearOnSnapperRise(this);
@ -504,7 +504,7 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_1;
this->timer = 30;
this->collider.base.ocFlags1 |= OC1_ON;
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
subCamEye.x = (Math_SinS(yaw) * 300.0f) + this->actor.focus.pos.x;
subCamEye.y = this->actor.focus.pos.y + 100.0f;
subCamEye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z;
@ -700,7 +700,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) {
Animation_Change(&this->skelAnime, &gGekkoJumpForwardAnim, 0.0f, 0.0f,
Animation_GetLastFrame(&gGekkoJumpForwardAnim), ANIMMODE_ONCE, 0.0f);
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child);
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.shape.rot.x = 0;
this->actor.shape.rot.z = 0;
@ -709,7 +709,7 @@ void EnPametfrog_SetupClimbDownWall(EnPametfrog* this) {
this->collider.base.acFlags &= ~AC_ON;
this->actor.velocity.y = 0.0f;
this->actor.gravity = -1.0f;
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actor.world.pos.x += 30.0f * Math_SinS(yaw);
this->actor.world.pos.z += 30.0f * Math_CosS(yaw);
this->actor.bgCheckFlags &= ~1;
@ -723,7 +723,7 @@ void EnPametfrog_ClimbDownWall(EnPametfrog* this, PlayState* play) {
if (this->actor.bgCheckFlags & 1) {
EnPametfrog_SetupRunToSnapper(this);
} else if (this->actor.floorHeight == BGCHECK_Y_MIN) {
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actor.world.pos.x += 5.0f * Math_SinS(yaw);
this->actor.world.pos.z += 5.0f * Math_CosS(yaw);
if (this->actor.world.pos.y < (this->actor.home.pos.y - 5.0f)) {
@ -741,7 +741,7 @@ void EnPametfrog_SetupRunToSnapper(EnPametfrog* this) {
void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
EnPametfrog_JumpOnGround(this, play);
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (!(this->actor.bgCheckFlags & 1) || ((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 12.0f))) {
this->actor.speedXZ = 12.0f;
@ -749,7 +749,7 @@ void EnPametfrog_RunToSnapper(EnPametfrog* this, PlayState* play) {
this->actor.speedXZ = 0.0f;
}
if ((this->actor.child->params == 1) && (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < 120.0f) &&
if ((this->actor.child->params == 1) && (Actor_WorldDistXZToActor(&this->actor, this->actor.child) < 120.0f) &&
Animation_OnFrame(&this->skelAnime, 0.0f)) {
EnPametfrog_SetupJumpOnSnapper(this);
}
@ -762,7 +762,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) {
this->collider.base.acFlags &= ~AC_ON;
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, this->actor.child);
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.params = GEKKO_JUMP_ON_SNAPPER;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET);
@ -822,7 +822,7 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, PlayState* play) {
}
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16);
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
this->actor.world.pos.x += 30.0f * Math_SinS(yaw);
this->actor.world.pos.z += 30.0f * Math_CosS(yaw);
if (this->subCamId != SUB_CAM_ID_DONE) {
@ -898,7 +898,7 @@ void EnPametfrog_FallOnGround(EnPametfrog* this, PlayState* play) {
void EnPametfrog_SetupDefeatGekko(EnPametfrog* this, PlayState* play) {
Vec3f subCamEye;
s16 yaw = Actor_YawToPoint(this->actor.child, &this->actor.home.pos);
s16 yaw = Actor_WorldYawTowardPoint(this->actor.child, &this->actor.home.pos);
s16 yawDiff = this->actor.yawTowardsPlayer - yaw;
yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000;
@ -923,7 +923,7 @@ void EnPametfrog_DefeatGekko(EnPametfrog* this, PlayState* play) {
void EnPametfrog_SetupDefeatSnapper(EnPametfrog* this, PlayState* play) {
Vec3f subCamEye;
s16 yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
s16 yawDiff = this->actor.yawTowardsPlayer - yaw;
yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000;
@ -1171,7 +1171,7 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET);
this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.colChkInfo.health = 6;
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
if (yawDiff > 0) {
this->actor.world.rot.y -= 0x2000;
@ -1209,7 +1209,7 @@ void EnPametfrog_SetupSnapperSpawn(EnPametfrog* this, PlayState* play) {
subCamAt.x = this->actor.child->world.pos.x;
subCamAt.z = this->actor.child->world.pos.z;
subCamAt.y = this->actor.child->floorHeight + 50.0f;
if ((s16)(Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y) > 0) {
if ((s16)(Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y) > 0) {
yaw = this->actor.child->shape.rot.y - 0x1000;
} else {
yaw = this->actor.child->shape.rot.y + 0x1000;

View File

@ -449,7 +449,7 @@ void func_80897A94(EnPeehat* this, PlayState* play) {
this->unk_2B0 = 40;
} else if (this->colliderCylinder.base.ocFlags1 & OC1_HIT) {
this->colliderCylinder.base.ocFlags1 &= ~OC1_HIT;
if ((BINANG_SUB(Actor_YawBetweenActors(&this->actor, this->colliderCylinder.base.oc),
if ((BINANG_SUB(Actor_WorldYawTowardActor(&this->actor, this->colliderCylinder.base.oc),
this->actor.world.rot.y)) > 0) {
this->actor.world.rot.y -= 0x2000;
} else {

View File

@ -374,9 +374,11 @@ void EnPoSisters_AimlessIdleFlying(EnPoSisters* this, PlayState* play) {
}
if (this->actor.bgCheckFlags & 8) { // touching a wall
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x71C);
} else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 600.0f) {
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 0x71C);
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
0x71C);
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 600.0f) {
Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
0x71C);
}
}

View File

@ -252,8 +252,8 @@ void func_80B2CBBC(EnPoh* this, PlayState* play) {
this->unk_18E--;
}
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 400.0f) {
this->unk_192 = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f) {
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_192, 0x71C);

View File

@ -537,7 +537,7 @@ void EnRailgibud_SetupWalkToHome(EnRailgibud* this) {
void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) {
Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0);
Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0);
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 5.0f) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) {
if (this->actor.speedXZ > 0.2f) {
this->actor.speedXZ -= 0.2f;
} else {
@ -550,7 +550,8 @@ void EnRailgibud_WalkToHome(EnRailgibud* this, PlayState* play) {
EnRailgibud_SetupWalkInCircles(this);
}
} else {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 450);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
450);
this->actor.world.rot = this->actor.shape.rot;
}
if (EnRailgibud_PlayerInRangeWithCorrectState(this, play)) {
@ -750,7 +751,7 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play
return false;
}
if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f &&
if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 100.0f &&
!(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) &&
!(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) {
@ -768,7 +769,7 @@ s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, PlayState* play
s32 EnRailgibud_PlayerOutOfRange(EnRailgibud* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 100.0f) {
if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 100.0f) {
return true;
}

View File

@ -293,7 +293,7 @@ void EnRat_ChooseDirection(EnRat* this) {
angle -= 0x8000;
}
} else {
if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) > 50.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) > 50.0f) {
Vec3f homeInHome;
Vec3f worldInHome;
Vec3f worldPlusForwardInHome;

View File

@ -649,11 +649,11 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
SkelAnime_Update(&this->skelAnime);
if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
EnRd_SetupWalkToHome(this, play);
}
if ((ABS_ALT(yaw) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) {
if ((ABS_ALT(yaw) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) {
if (!(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) &&
!(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) {
@ -676,11 +676,11 @@ void EnRd_WalkToPlayer(EnRd* this, PlayState* play) {
this->grabWaitTimer--;
}
if (!this->grabWaitTimer && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 45.0f) &&
if (!this->grabWaitTimer && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 45.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
player->actor.freezeTimer = 0;
if ((player->transformation == PLAYER_FORM_GORON) || (player->transformation == PLAYER_FORM_DEKU)) {
if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) < 150.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) < 150.0f) {
// If the Gibdo/Redead tries to grab Goron or Deku Link, it will fail to
// do so. It will appear to take damage and shake its head side-to-side.
EnRd_SetupGrabFail(this);
@ -716,9 +716,9 @@ void EnRd_SetupWalkToHome(EnRd* this, PlayState* play) {
void EnRd_WalkToHome(EnRd* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
s16 sp36 = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
s16 sp36 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) {
Math_SmoothStepToS(&this->actor.shape.rot.y, sp36, 1, 450, 0);
} else {
this->actor.speedXZ = 0.0f;
@ -739,7 +739,7 @@ void EnRd_WalkToHome(EnRd* this, PlayState* play) {
if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
!(player->stateFlags2 & (0x4000 | 0x80)) && (player->transformation != PLAYER_FORM_GORON) &&
(player->transformation != PLAYER_FORM_DEKU) &&
(Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) {
(Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) {
this->actor.targetMode = 0;
EnRd_SetupWalkToPlayer(this, play);
} else if (EN_RD_GET_TYPE(&this->actor) > EN_RD_TYPE_DOES_NOT_MOURN_IF_WALKING) {
@ -779,10 +779,10 @@ void EnRd_WalkToParent(EnRd* this, PlayState* play) {
if (this->actor.parent != NULL) {
parentPos = this->actor.parent->world.pos;
yaw = Actor_YawToPoint(&this->actor, &parentPos);
yaw = Actor_WorldYawTowardPoint(&this->actor, &parentPos);
Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 250, 0);
if (Actor_DistanceToPoint(&this->actor, &parentPos) >= 45.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &parentPos) >= 45.0f) {
this->actor.speedXZ = 0.4f;
} else {
this->actor.speedXZ = 0.0f;
@ -1029,7 +1029,7 @@ void EnRd_Damage(EnRd* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.parent != NULL) {
EnRd_SetupWalkToParent(this);
} else if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
} else if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
EnRd_SetupWalkToHome(this, play);
} else {
EnRd_SetupWalkToPlayer(this, play);

View File

@ -428,7 +428,7 @@ s32 func_80BF45B4(EnRg* this) {
}
sp24 = 1;
} else if (this->unk_310 & 0x40) {
s16 yaw = Actor_YawBetweenActors(&this->actor, ((void)0, this->collider2.base.ac));
s16 yaw = Actor_WorldYawTowardActor(&this->actor, ((void)0, this->collider2.base.ac));
sp24 = 2;
if (this->actor.colorFilterTimer == 0) {
@ -625,8 +625,8 @@ s32 func_80BF4DA8(EnRg* this) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_80BF596C); i++) {
temp_f20 = Actor_XZDistanceToPoint(&this->actor, &D_80BF596C[i]);
temp_v1 = Actor_YawToPoint(&this->actor, &D_80BF596C[i]) - this->actor.world.rot.y;
temp_f20 = Actor_WorldDistXZToPoint(&this->actor, &D_80BF596C[i]);
temp_v1 = Actor_WorldYawTowardPoint(&this->actor, &D_80BF596C[i]) - this->actor.world.rot.y;
if ((temp_f20 < 100.0f) && (ABS_ALT(temp_v1) < 0xC00)) {
if (temp_v1 > 0) {

View File

@ -242,8 +242,8 @@ void EnSnowman_Init(Actor* thisx, PlayState* play) {
thisx->flags &= ~ACTOR_FLAG_1;
Collider_InitAndSetCylinder(play, &this->collider, thisx, &sSnowballCylinderInit);
thisx->world.rot.y = Actor_YawBetweenActors(thisx, &player->actor);
thisx->velocity.y = (Actor_XZDistanceBetweenActors(thisx, &player->actor) * 0.035f) + -5.0f;
thisx->world.rot.y = Actor_WorldYawTowardActor(thisx, &player->actor);
thisx->velocity.y = (Actor_WorldDistXZToActor(thisx, &player->actor) * 0.035f) + -5.0f;
thisx->velocity.y = CLAMP_MAX(thisx->velocity.y, 3.5f);
if (EN_SNOWMAN_GET_TYPE(thisx) == EN_SNOWMAN_TYPE_SMALL_SNOWBALL) {
thisx->speedXZ = 15.0f;
@ -405,8 +405,9 @@ void EnSnowman_MoveSnowPile(EnSnowman* this, PlayState* play) {
this->actor.world.rot.y = this->actor.shape.rot.y;
} else if (this->actor.bgCheckFlags & 8) {
this->snowPileTargetRotY = this->actor.wallYaw;
} else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 200.0f) {
this->snowPileTargetRotY = Actor_YawToPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14);
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 200.0f) {
this->snowPileTargetRotY =
Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) + ((s32)Rand_Next() >> 0x14);
} else if (Rand_ZeroOne() < 0.02f) {
this->snowPileTargetRotY += (s16)(((Rand_Next() >> 0x13) + 0x1000) * ((Rand_ZeroOne() < 0.5f) ? -1 : 1));
}
@ -902,7 +903,7 @@ void EnSnowman_Combine(EnSnowman* this, PlayState* play) {
SkelAnime_Update(&this->snowPileSkelAnime);
parent = (EnSnowman*)this->actor.parent;
child = (EnSnowman*)this->actor.child;
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->combinePos), 0x1000);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->combinePos), 0x1000);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->combineState == EN_SNOWMAN_COMBINE_STATE_ACTIVE) {
@ -940,7 +941,7 @@ void EnSnowman_Combine(EnSnowman* this, PlayState* play) {
this->fwork.targetScaleDuringCombine = 0.0f;
}
if (Actor_XZDistanceToPoint(&this->actor, &this->combinePos) < 20.0f) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->combinePos) < 20.0f) {
this->actor.speedXZ = 0.0f;
}

View File

@ -494,7 +494,7 @@ void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) {
void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) {
Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0);
Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0);
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 5.0f) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 5.0f) {
if (this->actor.speedXZ > 0.2f) {
this->actor.speedXZ -= 0.2f;
} else {
@ -507,7 +507,8 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, PlayState* play) {
EnTalkGibud_SetupIdle(this);
}
} else {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 450);
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos),
450);
this->actor.world.rot = this->actor.shape.rot;
}
if (EnTalkGibud_PlayerInRangeWithCorrectState(this, play)) {
@ -895,7 +896,7 @@ void EnTalkGibud_FacePlayerWhenTalking(EnTalkGibud* this, PlayState* play) {
s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) &&
if ((Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f) &&
!(player->stateFlags1 & (PLAYER_STATE1_80 | PLAYER_STATE1_2000 | PLAYER_STATE1_4000 | PLAYER_STATE1_40000 |
PLAYER_STATE1_80000 | PLAYER_STATE1_200000)) &&
!(player->stateFlags2 & (PLAYER_STATE2_80 | PLAYER_STATE2_4000))) {
@ -913,7 +914,7 @@ s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, PlayState* play
s32 EnTalkGibud_PlayerOutOfRange(EnTalkGibud* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
return true;
}

View File

@ -576,7 +576,7 @@ Actor* func_80A3F2BC(PlayState* play, EnTest3* this, s32 actorId, s32 category,
if (actorId == actor->id) {
f32 dy = this->player.actor.world.pos.y - actor->world.pos.y;
if ((fabsf(dy) < arg5) && (Actor_XZDistanceBetweenActors(&this->player.actor, actor) < arg4)) {
if ((fabsf(dy) < arg5) && (Actor_WorldDistXZToActor(&this->player.actor, actor) < arg4)) {
return actor;
}
}
@ -688,7 +688,7 @@ s32 func_80A3F8D4(EnTest3* this, PlayState* play, struct_80A41828* arg2, Schedul
func_80A3F15C(this, play, arg2);
if (((postActor = func_80A3F2BC(play, this, ACTOR_EN_PST, ACTORCAT_PROP, 100.0f, 20.0f)) != NULL) ||
((postActor = func_80A3F2BC(play, this, ACTOR_EN_PM, ACTORCAT_NPC, 100.0f, 20.0f)) != NULL)) {
this->player.actor.home.rot.y = Actor_YawBetweenActors(&this->player.actor, postActor);
this->player.actor.home.rot.y = Actor_WorldYawTowardActor(&this->player.actor, postActor);
}
play->startPlayerCutscene(play, &this->player, 0x61);
return true;

View File

@ -430,7 +430,7 @@ void func_80C11338(EnThiefbird* this, PlayState* play) {
item = (EnItem00*)SubS_FindActor(play, &item->actor, ACTORCAT_MISC, ACTOR_EN_ITEM00);
if (item != NULL) {
if (item->unk152 > 0) {
if (Actor_XZDistanceBetweenActors(&player->actor, &item->actor) > 10.0f) {
if (Actor_WorldDistXZToActor(&player->actor, &item->actor) > 10.0f) {
for (i = 0; i < ARRAY_COUNT(D_80C13664); i++) {
if (item->actor.params == D_80C13664[i]) {
break;
@ -438,7 +438,7 @@ void func_80C11338(EnThiefbird* this, PlayState* play) {
}
if (i != ARRAY_COUNT(D_80C13664)) {
temp_f0 = Actor_DistanceBetweenActors(&this->actor, &item->actor);
temp_f0 = Actor_WorldDistXYZToActor(&this->actor, &item->actor);
if (temp_f0 < phi_f20) {
this->unk_3EC = item;
phi_f20 = temp_f0;
@ -487,14 +487,14 @@ void func_80C11590(EnThiefbird* this, PlayState* play) {
if (this->actor.bgCheckFlags & 8) {
this->unk_192 = this->actor.wallYaw;
} else {
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->unk_192 = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) {
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
}
}
if (!Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_192, 5, 0x300, 0x10) && (sp38 != 0) &&
(Rand_ZeroOne() < 0.1f)) {
s16 yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y;
s16 yaw = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y;
if (yaw > 0) {
this->unk_192 += Rand_S16Offset(4096, 4096);
@ -554,7 +554,7 @@ void func_80C1193C(EnThiefbird* this, PlayState* play) {
this->unk_18E--;
}
pitch = Actor_PitchBetweenActors(&this->actor, &player->actor);
pitch = Actor_WorldPitchTowardActor(&this->actor, &player->actor);
pitch = CLAMP(pitch, -0x2800, 0x2800);
Math_SmoothStepToS(&this->actor.shape.rot.x, pitch, 4, 0x800, 0x80);
if (this->actor.bgCheckFlags & 8) {
@ -697,7 +697,7 @@ void func_80C11F6C(EnThiefbird* this, PlayState* play) {
this->unk_190 = -0x1000;
this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer);
} else {
this->unk_190 = Actor_PitchToPoint(&this->actor, &D_80C13920);
this->unk_190 = Actor_WorldPitchTowardPoint(&this->actor, &D_80C13920);
}
this->unk_18E = 40;
@ -737,8 +737,8 @@ void func_80C1215C(EnThiefbird* this, PlayState* play) {
} else if (this->unk_3E8 == 0) {
this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer);
} else {
this->unk_192 = Actor_YawToPoint(&this->actor, &D_80C13920);
this->unk_190 = Actor_PitchToPoint(&this->actor, &D_80C13920);
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &D_80C13920);
this->unk_190 = Actor_WorldPitchTowardPoint(&this->actor, &D_80C13920);
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_192, 6, 0x1000, 0x100);
@ -801,14 +801,15 @@ void func_80C124B0(EnThiefbird* this, PlayState* play) {
if (this->actor.bgCheckFlags & 8) {
this->unk_192 = this->actor.wallYaw;
} else {
this->unk_192 = Actor_YawToPoint(&this->actor, &D_80C13920);
this->unk_192 = Actor_WorldYawTowardPoint(&this->actor, &D_80C13920);
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_192, 6, 0x1000, 0x100);
Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_PitchToPoint(&this->actor, &D_80C13920), 6, 0x1000, 0x100);
Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &D_80C13920), 6, 0x1000,
0x100);
temp_v0 = func_800BC270(play, &this->actor, 80.0f, 0x138B0);
if (temp_v0 != NULL) {
temp_v1 = temp_v0->world.rot.x - Actor_PitchToPoint(temp_v0, &this->actor.focus.pos);
temp_v1 = temp_v0->world.rot.x - Actor_WorldPitchTowardPoint(temp_v0, &this->actor.focus.pos);
if (ABS_ALT(temp_v1) < 0x1800) {
if (temp_v1 > 0) {
this->unk_3E0 = 25.0f;
@ -826,7 +827,7 @@ void func_80C124B0(EnThiefbird* this, PlayState* play) {
this->unk_3E0 * Math_SinS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y);
}
if (Actor_DistanceToPoint(&this->actor, &D_80C13920) < 1000.0f) {
if (Actor_WorldDistXYZToPoint(&this->actor, &D_80C13920) < 1000.0f) {
func_80C126A8(this);
}
}
@ -863,7 +864,7 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if ((this->unk_3EC != NULL) && ((this->unk_3EC->actor.update == NULL) || (this->unk_3EC->unk152 == 0) ||
(Actor_XZDistanceBetweenActors(&player->actor, &this->unk_3EC->actor) <= 10.0f))) {
(Actor_WorldDistXZToActor(&player->actor, &this->unk_3EC->actor) <= 10.0f))) {
this->unk_3EC = NULL;
}
@ -883,13 +884,13 @@ void func_80C127F4(EnThiefbird* this, PlayState* play) {
if (this->actor.bgCheckFlags & 8) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 3, 0x2000, 0x100);
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawBetweenActors(&this->actor, &this->unk_3EC->actor), 3,
0x2000, 0x100);
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &this->unk_3EC->actor),
3, 0x2000, 0x100);
}
temp_v0 = Math_Vec3f_Pitch(&this->limbPos[9], &this->unk_3EC->actor.world.pos);
temp_v0 = CLAMP(temp_v0, -0x3000, 0x3000);
Math_SmoothStepToS(&this->actor.shape.rot.x, temp_v0, 4, 0x800, 0x80);
temp_f0 = Actor_DistanceToPoint(&this->unk_3EC->actor, &this->limbPos[9]);
temp_f0 = Actor_WorldDistXYZToPoint(&this->unk_3EC->actor, &this->limbPos[9]);
this->actor.speedXZ = (0.02f * temp_f0) + 2.0f;
this->actor.speedXZ = CLAMP_MAX(this->actor.speedXZ, 4.0f);
if ((this->unk_3EC->actor.speedXZ <= 0.0f) && (temp_f0 < 40.0f)) {

View File

@ -838,8 +838,8 @@ void func_80895AC0(EnTite* this, PlayState* play) {
if (temp_v0 > 0x3000) {
this->unk_2BC = (temp_v0 >> 9) * this->unk_2BC;
}
} else if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 200.0f) {
temp_v1 = this->actor.shape.rot.y - Actor_YawToPoint(&this->actor, &this->actor.home.pos);
} else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 200.0f) {
temp_v1 = this->actor.shape.rot.y - Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos);
temp_v0 = ABS_ALT(temp_v1);
if (temp_v0 > 0x2000) {
this->unk_2BC = (temp_v0 >> 9) * this->unk_2BC;

View File

@ -442,8 +442,8 @@ s32 func_80AECE60(EnTk* this, PlayState* play) {
do {
doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
if (doorIter != NULL) {
if (Actor_XZDistanceBetweenActors(&this->actor, doorIter) <= 120.0f) {
if (ABS(BINANG_SUB(Actor_YawToPoint(&this->actor, &doorIter->world.pos),
if (Actor_WorldDistXZToActor(&this->actor, doorIter) <= 120.0f) {
if (ABS(BINANG_SUB(Actor_WorldYawTowardPoint(&this->actor, &doorIter->world.pos),
this->actor.shape.rot.y)) <= 0x2000) {
this->unk_2CA |= 0x400;
door = (EnDoor*)doorIter;
@ -459,7 +459,7 @@ s32 func_80AECE60(EnTk* this, PlayState* play) {
do {
doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
if (doorIter != NULL) {
if (Actor_XZDistanceBetweenActors(&this->actor, doorIter) <= 160.0f) {
if (Actor_WorldDistXZToActor(&this->actor, doorIter) <= 160.0f) {
door = (EnDoor*)doorIter;
break;
}
@ -911,7 +911,7 @@ s32 func_80AEE300(PlayState* play, Actor* arg1, Actor* arg2, void* _arg3) {
f32 temp_f0;
if ((arg2 != arg1) && (ENTK_GET_F(arg2) == 3)) {
temp_f0 = Actor_DistanceBetweenActors(arg1, arg2);
temp_f0 = Actor_WorldDistXYZToActor(arg1, arg2);
if (temp_f0 < arg3->unk_04) {
arg3->unk_00 = arg2;
arg3->unk_04 = temp_f0;
@ -932,7 +932,7 @@ void func_80AEE374(EnTk* this, PlayState* play) {
return;
}
this->unk_2CC = Actor_YawToPoint(&this->actor, &sp30.unk_00->world.pos);
this->unk_2CC = Actor_WorldYawTowardPoint(&this->actor, &sp30.unk_00->world.pos);
this->actionFunc = func_80AEE414;
}
@ -968,7 +968,7 @@ void func_80AEE4D0(EnTk* this, PlayState* play) {
bigPoe = SubS_FindActor(play, bigPoe, ACTORCAT_PROP, ACTOR_EN_BIGPO);
if (bigPoe != NULL) {
if ((bigPoe->params == 3) && (Actor_DistanceBetweenActors(&this->actor, bigPoe) < 80.0f)) {
if ((bigPoe->params == 3) && (Actor_WorldDistXYZToActor(&this->actor, bigPoe) < 80.0f)) {
bigPoe->params = 4;
this->unk_2CA |= 0x20;
this->unk_2E4++;

View File

@ -98,7 +98,7 @@ void func_80A66278(EnWarpUzu* this, PlayState* play) {
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
func_80A66384(this, play);
} else {
phi_a0 = ABS((s16)(Actor_YawBetweenActors(&this->actor, &player->actor) - this->actor.shape.rot.y));
phi_a0 = ABS((s16)(Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.shape.rot.y));
temp_v0 = player->actor.shape.rot.y - this->actor.shape.rot.y;
phi_v1 = ABS(temp_v0);
if (phi_a0 >= 0x2AAB) {

View File

@ -119,7 +119,7 @@ u8 func_80966608(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
Player* player = GET_PLAYER(play);
u8 returnVal = 0;
if (WEATHER_TAG_RANGE100(&this->actor) > Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (WEATHER_TAG_RANGE100(&this->actor) > Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
if (play->envCtx.unk_1F == play->envCtx.unk_20) {
D_801BDBB8 = 1;
if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) {
@ -147,7 +147,7 @@ u8 func_80966758(EnWeatherTag* this, PlayState* play, UNK_TYPE a3, UNK_TYPE a4,
Player* player = GET_PLAYER(play);
u8 returnVal = 0;
if (WEATHER_TAG_RANGE100(&this->actor) < Actor_XZDistanceBetweenActors(&player->actor, &this->actor)) {
if (WEATHER_TAG_RANGE100(&this->actor) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) {
if (play->envCtx.unk_1F == play->envCtx.unk_20) {
D_801BDBB8 = 1;
if (!(play->envCtx.unk_1E == 0) || ((play->envCtx.unk_1F != 1) && (play->envCtx.unk_21 == 0))) {
@ -173,7 +173,7 @@ void func_8096689C(EnWeatherTag* this, PlayState* play) {
f32 distance;
f32 partialResult;
distance = Actor_XZDistanceBetweenActors(&player->actor, &this->actor);
distance = Actor_WorldDistXZToActor(&player->actor, &this->actor);
if (this->fadeDistance < distance) {
distance = this->fadeDistance;
}
@ -422,7 +422,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) {
Actor_GetClosestPosOnPath(this->pathPoints, this->pathCount, &GET_PLAYER(play)->actor.world.pos,
&this->actor.world.pos, false);
distance = Actor_XZDistanceBetweenActors(&player->actor, &this->actor);
distance = Actor_WorldDistXZToActor(&player->actor, &this->actor);
range = WEATHER_TAG_RANGE100(&this->actor);
if (distance < range) {
@ -447,7 +447,7 @@ void func_809672DC(EnWeatherTag* this, PlayState* play) {
void func_809674C8(EnWeatherTag* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (Actor_XZDistanceBetweenActors(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(&this->actor)) {
if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < WEATHER_TAG_RANGE100(&this->actor)) {
if (CURRENT_DAY == 2) {
if ((gSaveContext.save.time >= CLOCK_TIME(7, 0)) && (gSaveContext.save.time < CLOCK_TIME(17, 30)) &&
(play->envCtx.unk_F2[2] == 0)) {
@ -471,7 +471,7 @@ void func_809674C8(EnWeatherTag* this, PlayState* play) {
// WEATHERTAG_TYPE_LOCALDAY2RAIN 2
void func_80967608(EnWeatherTag* this, PlayState* play) {
if ((WEATHER_TAG_RANGE100(&this->actor) + 10.0f) <
Actor_XZDistanceBetweenActors(&GET_PLAYER(play)->actor, &this->actor)) {
Actor_WorldDistXZToActor(&GET_PLAYER(play)->actor, &this->actor)) {
gWeatherMode = 0;
EnWeatherTag_SetupAction(this, func_809674C8);
}

View File

@ -299,10 +299,10 @@ void EnWf_Init(Actor* thisx, PlayState* play) {
if (this->actor.child != NULL) {
Player* player = GET_PLAYER(play);
this->actor.child->xzDistToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &player->actor);
this->actor.child->xzDistToPlayer = Actor_WorldDistXZToActor(&this->actor, &player->actor);
this->unk_2A4 = (temp_s0 * 0.5f) + 45.0f;
this->unk_29C = 0x32000 / this->unk_2A4;
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, &player->actor);
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &player->actor);
this->actor.world.pos.x -= this->unk_2A4 * Math_SinS(this->actor.shape.rot.y);
this->actor.world.pos.z -= this->unk_2A4 * Math_CosS(this->actor.shape.rot.y);
}
@ -405,7 +405,7 @@ s32 func_80990948(PlayState* play, EnWf* this, s16 arg2) {
if (((this->unk_295 == 0) ||
((this->unk_295 == 1) && (this->actor.child != NULL) && (this->actor.child->update != NULL))) &&
(this->actor.xzDistToPlayer > 160.0f) &&
(this->unk_2A8 < Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos))) {
(this->unk_2A8 < Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos))) {
func_80993524(this);
return true;
}
@ -1217,7 +1217,7 @@ void func_80993018(EnWf* this, PlayState* play) {
} else if (this->actor.child->xzDistToPlayer < (80.0f + this->unk_2A4)) {
func_80993350(this);
} else {
s16 temp_v0 = Actor_YawBetweenActors(this->actor.child, &this->actor);
s16 temp_v0 = Actor_WorldYawTowardActor(this->actor.child, &this->actor);
s16 temp_v1 = BINANG_SUB(temp_v0 - this->actor.child->yawTowardsPlayer, 0x8000);
if (ABS_ALT(temp_v1) > 0x800) {
@ -1251,7 +1251,7 @@ void func_80993194(EnWf* this, PlayState* play) {
if (this->actor.child->xzDistToPlayer < (80.0f + this->unk_2A4)) {
func_80993350(this);
} else {
sp36 = Actor_YawBetweenActors(this->actor.child, &this->actor);
sp36 = Actor_WorldYawTowardActor(this->actor.child, &this->actor);
sp34 = Math_SmoothStepToS(&sp36, BINANG_ROT180(this->actor.child->yawTowardsPlayer), 10, this->unk_29C,
16);
this->actor.world.pos.x = (Math_SinS(sp36) * this->unk_2A4) + this->actor.child->world.pos.x;
@ -1293,7 +1293,7 @@ void func_809933A0(EnWf* this, PlayState* play) {
if (func_80990EAC(this)) {
func_80990ED4(this);
} else {
sp2E = Actor_YawBetweenActors(this->actor.child, &this->actor);
sp2E = Actor_WorldYawTowardActor(this->actor.child, &this->actor);
Math_ScaledStepToS(&sp2E, this->actor.child->yawTowardsPlayer, this->unk_29C >> 2);
sp2C = sp2E - this->actor.child->yawTowardsPlayer;
this->actor.world.pos.x = (Math_SinS(sp2E) * this->unk_2A4) + this->actor.child->world.pos.x;
@ -1330,7 +1330,7 @@ void func_8099357C(EnWf* this, PlayState* play) {
func_80990E4C(this, play);
if (this->unk_295 != 0) {
if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
sp2E = Actor_YawBetweenActors(&this->actor, this->actor.child);
sp2E = Actor_WorldYawTowardActor(&this->actor, this->actor.child);
if (func_80990EAC(this)) {
this->actor.child = NULL;
func_80991738(this);
@ -1348,7 +1348,7 @@ void func_8099357C(EnWf* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, sp2E, 10, 0x800, 16);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < (this->unk_2A4 + 10.0f)) {
if (Actor_WorldDistXZToActor(&this->actor, this->actor.child) < (this->unk_2A4 + 10.0f)) {
func_80993148(this);
}
} else {
@ -1356,10 +1356,10 @@ void func_8099357C(EnWf* this, PlayState* play) {
func_80991738(this);
}
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 10, 0x800,
16);
Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 10,
0x800, 16);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 40.0f) {
if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 40.0f) {
func_809910F0(this);
}
}
@ -1590,7 +1590,7 @@ s32 func_8099408C(PlayState* play, EnWf* this) {
s16 temp_v1;
if (temp_v0 != NULL) {
temp_v1 = (Actor_YawBetweenActors(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_29E;
temp_v1 = (Actor_WorldYawTowardActor(&this->actor, temp_v0) - this->actor.shape.rot.y) - this->unk_29E;
if (ABS_ALT(temp_v1) < 0x3000) {
if (Rand_ZeroOne() < 0.5f) {
func_8099223C(this);

View File

@ -247,7 +247,7 @@ void func_80AE9258(ObjBigicicle* this, PlayState* play) {
icePoly = (ObjIcePoly*)itemAction;
temp_f0 = this->actor.world.pos.y - icePoly->actor.world.pos.y;
if ((temp_f0 < icePoly->colliders1[0].dim.height) && (temp_f0 > 0.0f) &&
(Actor_XZDistanceBetweenActors(&this->actor, &icePoly->actor) < icePoly->colliders1[0].dim.radius)) {
(Actor_WorldDistXZToActor(&this->actor, &icePoly->actor) < icePoly->colliders1[0].dim.radius)) {
Flags_SetSwitch(play, this->actor.params);
this->actionFunc = func_80AE939C;
return;

View File

@ -82,7 +82,7 @@ void ObjBoyo_UpdatePlayerBumpValues(ObjBoyo* this, Player* target) {
void ObjBoyo_UpdatePirateBumpValues(ObjBoyo* src, EnKaizoku* target) {
target->unk_2F0 = 30.0f;
target->unk_2F4 = Actor_YawBetweenActors(&src->actor, &target->picto.actor);
target->unk_2F4 = Actor_WorldYawTowardActor(&src->actor, &target->picto.actor);
}
void ObjBoyo_UpdateBombBumpValues(ObjBoyo* src, EnBom* target) {

View File

@ -227,10 +227,10 @@ void func_809AB4A8(ObjGrassCarry* this, PlayState* play) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_194->unk_00);
this->actor.shape.rot.y = this->actor.world.rot.y = this->unk_194->unk_0C;
this->unk_198 = this2->unk_194->unk_0E;
this->actor.xzDistToPlayer = Actor_XZDistanceBetweenActors(&this->actor, &player->actor);
this->actor.xzDistToPlayer = Actor_WorldDistXZToActor(&this->actor, &player->actor);
this->actor.playerHeightRel = Actor_HeightDiff(&this->actor, &player->actor);
this->actor.xyzDistToPlayerSq = SQ(this->actor.xzDistToPlayer) + SQ(this->actor.playerHeightRel);
this->actor.yawTowardsPlayer = Actor_YawBetweenActors(&this->actor, &player->actor);
this->actor.yawTowardsPlayer = Actor_WorldYawTowardActor(&this->actor, &player->actor);
Actor_LiftActor(&this->actor, play);
}
}

View File

@ -722,16 +722,16 @@
0x800B6BD8:("Actor_MoveWithoutGravityReverse",),
0x800B6C04:("Actor_SetSpeeds",),
0x800B6C58:("Actor_UpdatePosFromSkelAnime",),
0x800B6CD4:("Actor_YawBetweenActors",),
0x800B6D00:("Actor_YawBetweenActorsTop",),
0x800B6D2C:("Actor_YawToPoint",),
0x800B6D50:("Actor_PitchBetweenActors",),
0x800B6D7C:("Actor_PitchBetweenActorsTop",),
0x800B6DA8:("Actor_PitchToPoint",),
0x800B6DCC:("Actor_DistanceBetweenActors",),
0x800B6DF8:("Actor_DistanceToPoint",),
0x800B6E1C:("Actor_XZDistanceBetweenActors",),
0x800B6E48:("Actor_XZDistanceToPoint",),
0x800B6CD4:("Actor_WorldYawTowardActor",),
0x800B6D00:("Actor_FocusYawTowardActor",),
0x800B6D2C:("Actor_WorldYawTowardPoint",),
0x800B6D50:("Actor_WorldPitchTowardActor",),
0x800B6D7C:("Actor_FocusPitchTowardActor",),
0x800B6DA8:("Actor_WorldPitchTowardPoint",),
0x800B6DCC:("Actor_WorldDistXYZToActor",),
0x800B6DF8:("Actor_WorldDistXYZToPoint",),
0x800B6E1C:("Actor_WorldDistXZToActor",),
0x800B6E48:("Actor_WorldDistXZToPoint",),
0x800B6E6C:("Actor_OffsetOfPointInActorCoords",),
0x800B6F0C:("Actor_HeightDiff",),
0x800B6F20:("func_800B6F20",),

View File

@ -137,6 +137,16 @@ wordReplace = {
"func_800B8214": "Actor_GetWorld",
"func_800B8248": "Actor_GetWorldPosShapeRot",
"func_800BE22C": "Actor_ApplyDamage",
"Actor_YawBetweenActors": "Actor_WorldYawTowardActor",
"Actor_YawBetweenActorsTop": "Actor_FocusYawTowardActor",
"Actor_YawToPoint": "Actor_WorldYawTowardPoint",
"Actor_PitchBetweenActors": "Actor_WorldPitchTowardActor",
"Actor_PitchBetweenActorsTop": "Actor_FocusPitchTowardActor",
"Actor_PitchToPoint": "Actor_WorldPitchTowardPoint",
"Actor_DistanceBetweenActors": "Actor_WorldDistXYZToActor",
"Actor_DistanceToPoint": "Actor_WorldDistXYZToPoint",
"Actor_XZDistanceBetweenActors": "Actor_WorldDistXZToActor",
"Actor_XZDistanceToPoint": "Actor_WorldDistXZToPoint",
"Audio_PlaySoundAtPosition": "SoundSource_PlaySfxAtFixedWorldPos",
"func_800F0590": "SoundSource_PlaySfxEachFrameAtFixedWorldPos",
"func_8016970C": "Play_SetCameraAtEye",

View File

@ -236,16 +236,16 @@ asm/non_matchings/code/z_actor/Actor_UpdateVelocityWithoutGravityReverse.s,Actor
asm/non_matchings/code/z_actor/Actor_MoveWithoutGravityReverse.s,Actor_MoveWithoutGravityReverse,0x800B6BD8,0xB
asm/non_matchings/code/z_actor/Actor_SetSpeeds.s,Actor_SetSpeeds,0x800B6C04,0x15
asm/non_matchings/code/z_actor/Actor_UpdatePosFromSkelAnime.s,Actor_UpdatePosFromSkelAnime,0x800B6C58,0x1F
asm/non_matchings/code/z_actor/Actor_YawBetweenActors.s,Actor_YawBetweenActors,0x800B6CD4,0xB
asm/non_matchings/code/z_actor/Actor_YawBetweenActorsTop.s,Actor_YawBetweenActorsTop,0x800B6D00,0xB
asm/non_matchings/code/z_actor/Actor_YawToPoint.s,Actor_YawToPoint,0x800B6D2C,0x9
asm/non_matchings/code/z_actor/Actor_PitchBetweenActors.s,Actor_PitchBetweenActors,0x800B6D50,0xB
asm/non_matchings/code/z_actor/Actor_PitchBetweenActorsTop.s,Actor_PitchBetweenActorsTop,0x800B6D7C,0xB
asm/non_matchings/code/z_actor/Actor_PitchToPoint.s,Actor_PitchToPoint,0x800B6DA8,0x9
asm/non_matchings/code/z_actor/Actor_DistanceBetweenActors.s,Actor_DistanceBetweenActors,0x800B6DCC,0xB
asm/non_matchings/code/z_actor/Actor_DistanceToPoint.s,Actor_DistanceToPoint,0x800B6DF8,0x9
asm/non_matchings/code/z_actor/Actor_XZDistanceBetweenActors.s,Actor_XZDistanceBetweenActors,0x800B6E1C,0xB
asm/non_matchings/code/z_actor/Actor_XZDistanceToPoint.s,Actor_XZDistanceToPoint,0x800B6E48,0x9
asm/non_matchings/code/z_actor/Actor_WorldYawTowardActor.s,Actor_WorldYawTowardActor,0x800B6CD4,0xB
asm/non_matchings/code/z_actor/Actor_FocusYawTowardActor.s,Actor_FocusYawTowardActor,0x800B6D00,0xB
asm/non_matchings/code/z_actor/Actor_WorldYawTowardPoint.s,Actor_WorldYawTowardPoint,0x800B6D2C,0x9
asm/non_matchings/code/z_actor/Actor_WorldPitchTowardActor.s,Actor_WorldPitchTowardActor,0x800B6D50,0xB
asm/non_matchings/code/z_actor/Actor_FocusPitchTowardActor.s,Actor_FocusPitchTowardActor,0x800B6D7C,0xB
asm/non_matchings/code/z_actor/Actor_WorldPitchTowardPoint.s,Actor_WorldPitchTowardPoint,0x800B6DA8,0x9
asm/non_matchings/code/z_actor/Actor_WorldDistXYZToActor.s,Actor_WorldDistXYZToActor,0x800B6DCC,0xB
asm/non_matchings/code/z_actor/Actor_WorldDistXYZToPoint.s,Actor_WorldDistXYZToPoint,0x800B6DF8,0x9
asm/non_matchings/code/z_actor/Actor_WorldDistXZToActor.s,Actor_WorldDistXZToActor,0x800B6E1C,0xB
asm/non_matchings/code/z_actor/Actor_WorldDistXZToPoint.s,Actor_WorldDistXZToPoint,0x800B6E48,0x9
asm/non_matchings/code/z_actor/Actor_OffsetOfPointInActorCoords.s,Actor_OffsetOfPointInActorCoords,0x800B6E6C,0x28
asm/non_matchings/code/z_actor/Actor_HeightDiff.s,Actor_HeightDiff,0x800B6F0C,0x5
asm/non_matchings/code/z_actor/func_800B6F20.s,func_800B6F20,0x800B6F20,0x2A

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
236 asm/non_matchings/code/z_actor/Actor_MoveWithoutGravityReverse.s Actor_MoveWithoutGravityReverse 0x800B6BD8 0xB
237 asm/non_matchings/code/z_actor/Actor_SetSpeeds.s Actor_SetSpeeds 0x800B6C04 0x15
238 asm/non_matchings/code/z_actor/Actor_UpdatePosFromSkelAnime.s Actor_UpdatePosFromSkelAnime 0x800B6C58 0x1F
239 asm/non_matchings/code/z_actor/Actor_YawBetweenActors.s asm/non_matchings/code/z_actor/Actor_WorldYawTowardActor.s Actor_YawBetweenActors Actor_WorldYawTowardActor 0x800B6CD4 0xB
240 asm/non_matchings/code/z_actor/Actor_YawBetweenActorsTop.s asm/non_matchings/code/z_actor/Actor_FocusYawTowardActor.s Actor_YawBetweenActorsTop Actor_FocusYawTowardActor 0x800B6D00 0xB
241 asm/non_matchings/code/z_actor/Actor_YawToPoint.s asm/non_matchings/code/z_actor/Actor_WorldYawTowardPoint.s Actor_YawToPoint Actor_WorldYawTowardPoint 0x800B6D2C 0x9
242 asm/non_matchings/code/z_actor/Actor_PitchBetweenActors.s asm/non_matchings/code/z_actor/Actor_WorldPitchTowardActor.s Actor_PitchBetweenActors Actor_WorldPitchTowardActor 0x800B6D50 0xB
243 asm/non_matchings/code/z_actor/Actor_PitchBetweenActorsTop.s asm/non_matchings/code/z_actor/Actor_FocusPitchTowardActor.s Actor_PitchBetweenActorsTop Actor_FocusPitchTowardActor 0x800B6D7C 0xB
244 asm/non_matchings/code/z_actor/Actor_PitchToPoint.s asm/non_matchings/code/z_actor/Actor_WorldPitchTowardPoint.s Actor_PitchToPoint Actor_WorldPitchTowardPoint 0x800B6DA8 0x9
245 asm/non_matchings/code/z_actor/Actor_DistanceBetweenActors.s asm/non_matchings/code/z_actor/Actor_WorldDistXYZToActor.s Actor_DistanceBetweenActors Actor_WorldDistXYZToActor 0x800B6DCC 0xB
246 asm/non_matchings/code/z_actor/Actor_DistanceToPoint.s asm/non_matchings/code/z_actor/Actor_WorldDistXYZToPoint.s Actor_DistanceToPoint Actor_WorldDistXYZToPoint 0x800B6DF8 0x9
247 asm/non_matchings/code/z_actor/Actor_XZDistanceBetweenActors.s asm/non_matchings/code/z_actor/Actor_WorldDistXZToActor.s Actor_XZDistanceBetweenActors Actor_WorldDistXZToActor 0x800B6E1C 0xB
248 asm/non_matchings/code/z_actor/Actor_XZDistanceToPoint.s asm/non_matchings/code/z_actor/Actor_WorldDistXZToPoint.s Actor_XZDistanceToPoint Actor_WorldDistXZToPoint 0x800B6E48 0x9
249 asm/non_matchings/code/z_actor/Actor_OffsetOfPointInActorCoords.s Actor_OffsetOfPointInActorCoords 0x800B6E6C 0x28
250 asm/non_matchings/code/z_actor/Actor_HeightDiff.s Actor_HeightDiff 0x800B6F0C 0x5
251 asm/non_matchings/code/z_actor/func_800B6F20.s func_800B6F20 0x800B6F20 0x2A