1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-25 14:16:11 +00:00

[Doc] name function func_8002DBD0 to Actor_WorldToActorCoords (#2029)

* name function Actor_WorldToActorCoords

* clean up some misleading usages
This commit is contained in:
krm01 2024-08-11 11:30:41 -07:00 committed by GitHub
parent fc79632df8
commit 8df87038a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 52 additions and 53 deletions

View file

@ -343,7 +343,7 @@ s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB);
s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint); s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint);
f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB); f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB);
f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint); f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint);
void func_8002DBD0(Actor* actor, Vec3f* dest, Vec3f* pos); void Actor_WorldToActorCoords(Actor* actor, Vec3f* dest, Vec3f* pos);
f32 Actor_HeightDiff(Actor* actorA, Actor* actorB); f32 Actor_HeightDiff(Actor* actorA, Actor* actorB);
f32 Player_GetHeight(Player* player); f32 Player_GetHeight(Player* player);
f32 func_8002DCE4(Player* player); f32 func_8002DCE4(Player* player);

View file

@ -987,9 +987,8 @@ f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) {
/** /**
* Convert `pos` to be relative to the actor's position and yaw, store into `dest`. * Convert `pos` to be relative to the actor's position and yaw, store into `dest`.
* Actor_WorldToActorCoords
*/ */
void func_8002DBD0(Actor* actor, Vec3f* dest, Vec3f* pos) { void Actor_WorldToActorCoords(Actor* actor, Vec3f* dest, Vec3f* pos) {
f32 cosY; f32 cosY;
f32 sinY; f32 sinY;
f32 deltaX; f32 deltaX;

View file

@ -58,7 +58,7 @@ void BgHaka_Destroy(Actor* thisx, PlayState* play) {
void BgHaka_CheckPlayerOnDirtPatch(BgHaka* this, Player* player) { void BgHaka_CheckPlayerOnDirtPatch(BgHaka* this, Player* player) {
Vec3f playerRelativePos; Vec3f playerRelativePos;
func_8002DBD0(&this->dyna.actor, &playerRelativePos, &player->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &playerRelativePos, &player->actor.world.pos);
if (fabsf(playerRelativePos.x) < 34.6f && playerRelativePos.z > -112.8f && playerRelativePos.z < -36.0f) { if (fabsf(playerRelativePos.x) < 34.6f && playerRelativePos.z > -112.8f && playerRelativePos.z < -36.0f) {
player->stateFlags2 |= PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND; player->stateFlags2 |= PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND;
} }

View file

@ -208,7 +208,7 @@ void func_8087FFC0(BgHakaTrap* this, PlayState* play) {
f32 zNonNegative; f32 zNonNegative;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &sp28, &player->actor.world.pos);
sine = Math_SinS(this->dyna.actor.shape.rot.y); sine = Math_SinS(this->dyna.actor.shape.rot.y);
cosine = Math_CosS(this->dyna.actor.shape.rot.y); cosine = Math_CosS(this->dyna.actor.shape.rot.y);
@ -431,7 +431,7 @@ void func_808809E4(BgHakaTrap* this, PlayState* play, s16 arg2) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Vec3f sp18; Vec3f sp18;
func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &sp18, &player->actor.world.pos);
if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) && if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) &&
(GET_PLAYER(play)->currentBoots != PLAYER_BOOTS_IRON)) { (GET_PLAYER(play)->currentBoots != PLAYER_BOOTS_IRON)) {

View file

@ -81,12 +81,12 @@ void BgHidanFirewall_Destroy(Actor* thisx, PlayState* play) {
s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, PlayState* play) { s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, PlayState* play) {
Player* player; Player* player;
Vec3f distance; Vec3f playerRelativePos;
player = GET_PLAYER(play); player = GET_PLAYER(play);
func_8002DBD0(&this->actor, &distance, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &playerRelativePos, &player->actor.world.pos);
if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) { if (fabsf(playerRelativePos.x) < 100.0f && fabsf(playerRelativePos.z) < 120.0f) {
return 1; return 1;
} }
return 0; return 0;
@ -137,39 +137,39 @@ void BgHidanFirewall_Collide(BgHidanFirewall* this, PlayState* play) {
void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play) { void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play) {
Player* player; Player* player;
Vec3f sp30; Vec3f playerRelativePos;
f32 temp_ret; f32 temp_ret;
f32 sp28; f32 sp28;
f32 phi_f0; f32 phi_f0;
player = GET_PLAYER(play); player = GET_PLAYER(play);
func_8002DBD0(&this->actor, &sp30, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &playerRelativePos, &player->actor.world.pos);
if (sp30.x < -70.0f) { if (playerRelativePos.x < -70.0f) {
sp30.x = -70.0f; playerRelativePos.x = -70.0f;
} else { } else {
if (70.0f < sp30.x) { if (70.0f < playerRelativePos.x) {
phi_f0 = 70.0f; phi_f0 = 70.0f;
} else { } else {
phi_f0 = sp30.x; phi_f0 = playerRelativePos.x;
} }
sp30.x = phi_f0; playerRelativePos.x = phi_f0;
} }
if (this->actor.params == 0) { if (this->actor.params == 0) {
if (0.0f < sp30.z) { if (0.0f < playerRelativePos.z) {
sp30.z = -25.0f; playerRelativePos.z = -25.0f;
this->actor.params = -1; this->actor.params = -1;
} else { } else {
sp30.z = 25.0f; playerRelativePos.z = 25.0f;
this->actor.params = 1; this->actor.params = 1;
} }
} else { } else {
sp30.z = this->actor.params * 25.0f; playerRelativePos.z = this->actor.params * 25.0f;
} }
sp28 = Math_SinS(this->actor.shape.rot.y); sp28 = Math_SinS(this->actor.shape.rot.y);
temp_ret = Math_CosS(this->actor.shape.rot.y); temp_ret = Math_CosS(this->actor.shape.rot.y);
this->collider.dim.pos.x = this->actor.world.pos.x + sp30.x * temp_ret + sp30.z * sp28; this->collider.dim.pos.x = this->actor.world.pos.x + playerRelativePos.x * temp_ret + playerRelativePos.z * sp28;
this->collider.dim.pos.z = this->actor.world.pos.z - sp30.x * sp28 + sp30.z * temp_ret; this->collider.dim.pos.z = this->actor.world.pos.z - playerRelativePos.x * sp28 + playerRelativePos.z * temp_ret;
} }
void BgHidanFirewall_Update(Actor* thisx, PlayState* play) { void BgHidanFirewall_Update(Actor* thisx, PlayState* play) {

View file

@ -195,25 +195,25 @@ void BgHidanFwbig_Move(BgHidanFwbig* this, PlayState* play) {
void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, PlayState* play) { void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Vec3f projPos; Vec3f playerRelativePos;
f32 cs; f32 cs;
f32 sn; f32 sn;
func_8002DBD0(&this->actor, &projPos, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &playerRelativePos, &player->actor.world.pos);
projPos.z = ((projPos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f; playerRelativePos.z = ((playerRelativePos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f;
if (this->direction == 0) { if (this->direction == 0) {
projPos.x = CLAMP(projPos.x, -360.0f, 360.0f); playerRelativePos.x = CLAMP(playerRelativePos.x, -360.0f, 360.0f);
} else { } else {
projPos.x = CLAMP(projPos.x, -500.0f, 500.0f); playerRelativePos.x = CLAMP(playerRelativePos.x, -500.0f, 500.0f);
} }
sn = Math_SinS(this->actor.shape.rot.y); sn = Math_SinS(this->actor.shape.rot.y);
cs = Math_CosS(this->actor.shape.rot.y); cs = Math_CosS(this->actor.shape.rot.y);
this->collider.dim.pos.x = this->actor.world.pos.x + (projPos.x * cs) + (projPos.z * sn); this->collider.dim.pos.x = this->actor.world.pos.x + (playerRelativePos.x * cs) + (playerRelativePos.z * sn);
this->collider.dim.pos.z = this->actor.world.pos.z - (projPos.x * sn) + (projPos.z * cs); this->collider.dim.pos.z = this->actor.world.pos.z - (playerRelativePos.x * sn) + (playerRelativePos.z * cs);
this->collider.dim.pos.y = this->actor.world.pos.y; this->collider.dim.pos.y = this->actor.world.pos.y;
this->actor.world.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; this->actor.world.rot.y = (playerRelativePos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000;
} }
void BgHidanFwbig_Update(Actor* thisx, PlayState* play) { void BgHidanFwbig_Update(Actor* thisx, PlayState* play) {

View file

@ -395,7 +395,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) {
this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f; this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f;
BgYdanSp_BurnWeb(this, play); BgYdanSp_BurnWeb(this, play);
} else if (player->heldItemAction == PLAYER_IA_DEKU_STICK && player->unk_860 != 0) { } else if (player->heldItemAction == PLAYER_IA_DEKU_STICK && player->unk_860 != 0) {
func_8002DBD0(&this->dyna.actor, &sp30, &player->meleeWeaponInfo[0].tip); Actor_WorldToActorCoords(&this->dyna.actor, &sp30, &player->meleeWeaponInfo[0].tip);
if (fabsf(sp30.x) < 100.0f && sp30.z < 1.0f && sp30.y < 200.0f) { if (fabsf(sp30.x) < 100.0f && sp30.z < 1.0f && sp30.y < 200.0f) {
OnePointCutscene_Init(play, 3020, 40, &this->dyna.actor, CAM_ID_MAIN); OnePointCutscene_Init(play, 3020, 40, &this->dyna.actor, CAM_ID_MAIN);
Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->meleeWeaponInfo[0].tip); Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->meleeWeaponInfo[0].tip);

View file

@ -1055,8 +1055,8 @@ void BossSst_HeadDeath(BossSst* this, PlayState* play) {
player->actor.world.pos.z = sRoomCenter.z + (400.0f * Math_CosS(this->actor.shape.rot.y)) - player->actor.world.pos.z = sRoomCenter.z + (400.0f * Math_CosS(this->actor.shape.rot.y)) -
(Math_SinS(this->actor.shape.rot.y) * -120.0f); (Math_SinS(this->actor.shape.rot.y) * -120.0f);
player->actor.shape.rot.y = Actor_WorldYawTowardPoint(&player->actor, &sRoomCenter); player->actor.shape.rot.y = Actor_WorldYawTowardPoint(&player->actor, &sRoomCenter);
func_8002DBD0(&this->actor, &sSubCamEye, &GET_ACTIVE_CAM(play)->eye); Actor_WorldToActorCoords(&this->actor, &sSubCamEye, &GET_ACTIVE_CAM(play)->eye);
func_8002DBD0(&this->actor, &sSubCamAt, &GET_ACTIVE_CAM(play)->at); Actor_WorldToActorCoords(&this->actor, &sSubCamAt, &GET_ACTIVE_CAM(play)->at);
this->radius = -350.0f; this->radius = -350.0f;
this->actor.world.pos.x = sRoomCenter.x - (Math_SinS(this->actor.shape.rot.y) * 350.0f); this->actor.world.pos.x = sRoomCenter.x - (Math_SinS(this->actor.shape.rot.y) * 350.0f);
this->actor.world.pos.z = sRoomCenter.z - (Math_CosS(this->actor.shape.rot.y) * 350.0f); this->actor.world.pos.z = sRoomCenter.z - (Math_CosS(this->actor.shape.rot.y) * 350.0f);
@ -2640,8 +2640,8 @@ void BossSst_UpdateHead(Actor* thisx, PlayState* play) {
s32 pad; s32 pad;
BossSst* this = (BossSst*)thisx; BossSst* this = (BossSst*)thisx;
func_8002DBD0(&this->actor, &sHandOffsets[RIGHT], &sHands[RIGHT]->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &sHandOffsets[RIGHT], &sHands[RIGHT]->actor.world.pos);
func_8002DBD0(&this->actor, &sHandOffsets[LEFT], &sHands[LEFT]->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &sHandOffsets[LEFT], &sHands[LEFT]->actor.world.pos);
sHandYawOffsets[LEFT] = sHands[LEFT]->actor.shape.rot.y - thisx->shape.rot.y; sHandYawOffsets[LEFT] = sHands[LEFT]->actor.shape.rot.y - thisx->shape.rot.y;
sHandYawOffsets[RIGHT] = sHands[RIGHT]->actor.shape.rot.y - thisx->shape.rot.y; sHandYawOffsets[RIGHT] = sHands[RIGHT]->actor.shape.rot.y - thisx->shape.rot.y;

View file

@ -67,7 +67,7 @@ f32 func_809946BC(PlayState* play, DoorGerudo* this, f32 arg2, f32 arg3, f32 arg
playerPos.x = player->actor.world.pos.x; playerPos.x = player->actor.world.pos.x;
playerPos.y = player->actor.world.pos.y + arg2; playerPos.y = player->actor.world.pos.y + arg2;
playerPos.z = player->actor.world.pos.z; playerPos.z = player->actor.world.pos.z;
func_8002DBD0(&this->dyna.actor, &sp1C, &playerPos); Actor_WorldToActorCoords(&this->dyna.actor, &sp1C, &playerPos);
if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) { if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) {
return MAXFLOAT; return MAXFLOAT;

View file

@ -349,7 +349,7 @@ void DoorKiller_FallOver(DoorKiller* this, PlayState* play) {
if (!(this->hasHitPlayerOrGround & 1)) { if (!(this->hasHitPlayerOrGround & 1)) {
Vec3f playerPosRelToDoor; Vec3f playerPosRelToDoor;
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &playerPosRelToDoor, &player->actor.world.pos);
if ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) && if ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) &&
(playerPosRelToDoor.z < 100.0f) && (playerPosRelToDoor.z > 0.0f)) { (playerPosRelToDoor.z < 100.0f) && (playerPosRelToDoor.z > 0.0f)) {
this->hasHitPlayerOrGround |= 1; this->hasHitPlayerOrGround |= 1;
@ -411,7 +411,7 @@ void DoorKiller_Wait(DoorKiller* this, PlayState* play) {
Vec3f playerPosRelToDoor; Vec3f playerPosRelToDoor;
s16 angleToFacingPlayer; s16 angleToFacingPlayer;
func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &playerPosRelToDoor, &player->actor.world.pos);
// playerIsOpening is set by player // playerIsOpening is set by player
if (this->playerIsOpening) { if (this->playerIsOpening) {

View file

@ -508,7 +508,7 @@ f32 DoorShutter_GetPlayerDistance(PlayState* play, DoorShutter* this, f32 offset
playerPos.y = player->actor.world.pos.y + offsetY; playerPos.y = player->actor.world.pos.y + offsetY;
playerPos.z = player->actor.world.pos.z; playerPos.z = player->actor.world.pos.z;
func_8002DBD0(&this->dyna.actor, &relPlayerPos, &playerPos); Actor_WorldToActorCoords(&this->dyna.actor, &relPlayerPos, &playerPos);
if (fabsf(relPlayerPos.x) > maxDistSides || fabsf(relPlayerPos.y) > maxDistY) { if (fabsf(relPlayerPos.x) > maxDistSides || fabsf(relPlayerPos.y) > maxDistY) {
return MAXFLOAT; return MAXFLOAT;
@ -800,7 +800,7 @@ void DoorShutter_SetupClosed(DoorShutter* this, PlayState* play) {
if (this->dyna.actor.room >= 0) { if (this->dyna.actor.room >= 0) {
Vec3f relPlayerPos; Vec3f relPlayerPos;
func_8002DBD0(&this->dyna.actor, &relPlayerPos, &player->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &relPlayerPos, &player->actor.world.pos);
this->dyna.actor.room = play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)] this->dyna.actor.room = play->transiActorCtx.list[GET_TRANSITION_ACTOR_INDEX(&this->dyna.actor)]
.sides[(relPlayerPos.z < 0.0f) ? 0 : 1] .sides[(relPlayerPos.z < 0.0f) ? 0 : 1]
.room; .room;

View file

@ -498,7 +498,7 @@ void func_809BDC08(EnBigokuta* this, PlayState* play) {
} }
phi_v1 = (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) - 180.0f) * (8.0f / 15); phi_v1 = (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) - 180.0f) * (8.0f / 15);
func_8002DBD0(&this->actor, &sp28, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &sp28, &player->actor.world.pos);
if (fabsf(sp28.x) > 263.0f || ((sp28.z > 0.0f) && !Actor_IsFacingPlayer(&this->actor, 0x1B00) && if (fabsf(sp28.x) > 263.0f || ((sp28.z > 0.0f) && !Actor_IsFacingPlayer(&this->actor, 0x1B00) &&
!Player_IsFacingActor(&this->actor, 0x2000, play))) { !Player_IsFacingActor(&this->actor, 0x2000, play))) {
phi_v1 -= 0x80; phi_v1 -= 0x80;

View file

@ -421,7 +421,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) {
Flags_SetTreasure(play, this->dyna.actor.params & 0x1F); Flags_SetTreasure(play, this->dyna.actor.params & 0x1F);
} else { } else {
player = GET_PLAYER(play); player = GET_PLAYER(play);
func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &sp4C, &player->actor.world.pos);
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) { Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) {
Actor_OfferGetItemNearby(&this->dyna.actor, play, 0 - (this->dyna.actor.params >> 5 & 0x7F)); Actor_OfferGetItemNearby(&this->dyna.actor, play, 0 - (this->dyna.actor.params >> 5 & 0x7F));

View file

@ -220,7 +220,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) {
Vec3f playerPosRelToDoor; Vec3f playerPosRelToDoor;
doorType = ENDOOR_GET_TYPE(&this->actor); doorType = ENDOOR_GET_TYPE(&this->actor);
func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &playerPosRelToDoor, &player->actor.world.pos);
if (this->playerIsOpening) { if (this->playerIsOpening) {
this->actionFunc = EnDoor_Open; this->actionFunc = EnDoor_Open;
Animation_PlayOnceSetSpeed(&this->skelAnime, sDoorAnims[this->openAnim], Animation_PlayOnceSetSpeed(&this->skelAnime, sDoorAnims[this->openAnim],

View file

@ -186,7 +186,7 @@ void EnHoll_HorizontalVisibleNarrow(EnHoll* this, PlayState* play) {
f32 orthogonalDistToPlayer; f32 orthogonalDistToPlayer;
s32 transitionActorIndex; s32 transitionActorIndex;
func_8002DBD0(&this->actor, &relPlayerPos, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &relPlayerPos, &player->actor.world.pos);
this->side = (relPlayerPos.z < 0.0f) ? 0 : 1; this->side = (relPlayerPos.z < 0.0f) ? 0 : 1;
orthogonalDistToPlayer = fabsf(relPlayerPos.z); orthogonalDistToPlayer = fabsf(relPlayerPos.z);
if (relPlayerPos.y > ENHOLL_H_Y_MIN && relPlayerPos.y < ENHOLL_H_Y_MAX && if (relPlayerPos.y > ENHOLL_H_Y_MIN && relPlayerPos.y < ENHOLL_H_Y_MAX &&
@ -227,7 +227,7 @@ void EnHoll_HorizontalInvisible(EnHoll* this, PlayState* play) {
f32 hollHalfWidth; f32 hollHalfWidth;
f32 orthogonalDistToSubject; f32 orthogonalDistToSubject;
func_8002DBD0(&this->actor, &relSubjectPos, useViewEye ? &play->view.eye : &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &relSubjectPos, useViewEye ? &play->view.eye : &player->actor.world.pos);
hollHalfWidth = hollHalfWidth =
(ENHOLL_GET_TYPE(&this->actor) == ENHOLL_H_INVISIBLE_NARROW) ? ENHOLL_H_HALFWIDTH_NARROW : ENHOLL_H_HALFWIDTH; (ENHOLL_GET_TYPE(&this->actor) == ENHOLL_H_INVISIBLE_NARROW) ? ENHOLL_H_HALFWIDTH_NARROW : ENHOLL_H_HALFWIDTH;
@ -355,7 +355,7 @@ void EnHoll_HorizontalBgCoverSwitchFlag(EnHoll* this, PlayState* play) {
Vec3f relPlayerPos; Vec3f relPlayerPos;
f32 orthogonalDistToPlayer; f32 orthogonalDistToPlayer;
func_8002DBD0(&this->actor, &relPlayerPos, &player->actor.world.pos); Actor_WorldToActorCoords(&this->actor, &relPlayerPos, &player->actor.world.pos);
orthogonalDistToPlayer = fabsf(relPlayerPos.z); orthogonalDistToPlayer = fabsf(relPlayerPos.z);
if (ENHOLL_H_Y_MIN < relPlayerPos.y && relPlayerPos.y < ENHOLL_H_Y_MAX && if (ENHOLL_H_Y_MIN < relPlayerPos.y && relPlayerPos.y < ENHOLL_H_Y_MAX &&

View file

@ -226,7 +226,7 @@ void EnRiverSound_Update(Actor* thisx, PlayState* play) {
} }
} }
} else if ((thisx->params == RS_GORON_CITY_SARIAS_SONG) || (thisx->params == RS_GREAT_FAIRY)) { } else if ((thisx->params == RS_GORON_CITY_SARIAS_SONG) || (thisx->params == RS_GREAT_FAIRY)) {
func_8002DBD0(&player->actor, &thisx->home.pos, &thisx->world.pos); Actor_WorldToActorCoords(&player->actor, &thisx->home.pos, &thisx->world.pos);
} else if (play->sceneId == SCENE_DODONGOS_CAVERN_BOSS && Flags_GetClear(play, thisx->room)) { } else if (play->sceneId == SCENE_DODONGOS_CAVERN_BOSS && Flags_GetClear(play, thisx->room)) {
Actor_Kill(thisx); Actor_Kill(thisx);
} }

View file

@ -152,13 +152,13 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, PlayState* play) {
} }
if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) { if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) {
Vec3f distance; Vec3f playerRelativePos;
f32 blockSize; f32 blockSize;
func_8002DBD0(&this->dyna.actor, &distance, &GET_PLAYER(play)->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &playerRelativePos, &GET_PLAYER(play)->actor.world.pos);
blockSize = this->dyna.actor.scale.x * 50.0f + 6.0f; blockSize = this->dyna.actor.scale.x * 50.0f + 6.0f;
// Return true if player's xz position is not inside the block // Return true if player's xz position is not inside the block
if (blockSize < fabsf(distance.x) || blockSize < fabsf(distance.z)) { if (blockSize < fabsf(playerRelativePos.x) || blockSize < fabsf(playerRelativePos.z)) {
return true; return true;
} }
} }

View file

@ -86,14 +86,14 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) {
if ((this->dyna.actor.xzDistToPlayer <= sDistances[(((this->dyna.actor.params >> 0xB) & 7))]) || if ((this->dyna.actor.xzDistToPlayer <= sDistances[(((this->dyna.actor.params >> 0xB) & 7))]) ||
(temp_a3->xzDistToPlayer <= sDistances[(((temp_a3->params >> 0xB) & 7))])) { (temp_a3->xzDistToPlayer <= sDistances[(((temp_a3->params >> 0xB) & 7))])) {
func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos); Actor_WorldToActorCoords(&this->dyna.actor, &sp20, &player->actor.world.pos);
temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f; temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f;
if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) { if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) {
return 0; return 0;
} }
func_8002DBD0(temp_a3, &sp20, &player->actor.world.pos); Actor_WorldToActorCoords(temp_a3, &sp20, &player->actor.world.pos);
temp_f2 = (temp_a3->scale.x * 50.0f) + 6.0f; temp_f2 = (temp_a3->scale.x * 50.0f) + 6.0f;
if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) { if (!(temp_f2 < fabsf(sp20.x)) && !(temp_f2 < fabsf(sp20.z))) {

View file

@ -9753,7 +9753,7 @@ void Player_Action_80846120(Player* this, PlayState* play) {
this->heldActor = &heavyBlock->dyna.actor; this->heldActor = &heavyBlock->dyna.actor;
this->actor.child = &heavyBlock->dyna.actor; this->actor.child = &heavyBlock->dyna.actor;
heavyBlock->dyna.actor.parent = &this->actor; heavyBlock->dyna.actor.parent = &this->actor;
func_8002DBD0(&heavyBlock->dyna.actor, &heavyBlock->unk_164, &this->leftHandPos); Actor_WorldToActorCoords(&heavyBlock->dyna.actor, &heavyBlock->unk_164, &this->leftHandPos);
} else if (LinkAnimation_OnFrame(&this->skelAnime, 229.0f)) { } else if (LinkAnimation_OnFrame(&this->skelAnime, 229.0f)) {
Actor* heldActor = this->heldActor; Actor* heldActor = this->heldActor;