Rename a lot of actor movement-related functions from decomp (#4680)
This commit is contained in:
@@ -1255,7 +1255,7 @@ void Actor_Destroy(Actor* actor, PlayState* play) {
|
||||
NameTag_RemoveAllForActor(actor);
|
||||
}
|
||||
|
||||
void func_8002D7EC(Actor* actor) {
|
||||
void Actor_UpdatePos(Actor* actor) {
|
||||
f32 speedRate = R_UPDATE_RATE * 0.5f;
|
||||
|
||||
actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x;
|
||||
@@ -1263,7 +1263,7 @@ void func_8002D7EC(Actor* actor) {
|
||||
actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z;
|
||||
}
|
||||
|
||||
void func_8002D868(Actor* actor) {
|
||||
void Actor_UpdateVelocityXZGravity(Actor* actor) {
|
||||
actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ;
|
||||
actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ;
|
||||
|
||||
@@ -1273,12 +1273,12 @@ void func_8002D868(Actor* actor) {
|
||||
}
|
||||
}
|
||||
|
||||
void Actor_MoveForward(Actor* actor) {
|
||||
func_8002D868(actor);
|
||||
func_8002D7EC(actor);
|
||||
void Actor_MoveXZGravity(Actor* actor) {
|
||||
Actor_UpdateVelocityXZGravity(actor);
|
||||
Actor_UpdatePos(actor);
|
||||
}
|
||||
|
||||
void func_8002D908(Actor* actor) {
|
||||
void Actor_UpdateVelocityXYZ(Actor* actor) {
|
||||
f32 sp24 = Math_CosS(actor->world.rot.x) * actor->speedXZ;
|
||||
|
||||
actor->velocity.x = Math_SinS(actor->world.rot.y) * sp24;
|
||||
@@ -1286,17 +1286,17 @@ void func_8002D908(Actor* actor) {
|
||||
actor->velocity.z = Math_CosS(actor->world.rot.y) * sp24;
|
||||
}
|
||||
|
||||
void func_8002D97C(Actor* actor) {
|
||||
func_8002D908(actor);
|
||||
func_8002D7EC(actor);
|
||||
void Actor_MoveXYZ(Actor* actor) {
|
||||
Actor_UpdateVelocityXYZ(actor);
|
||||
Actor_UpdatePos(actor);
|
||||
}
|
||||
|
||||
void func_8002D9A4(Actor* actor, f32 arg1) {
|
||||
void Actor_SetProjectileSpeed(Actor* actor, f32 arg1) {
|
||||
actor->speedXZ = Math_CosS(actor->world.rot.x) * arg1;
|
||||
actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1;
|
||||
}
|
||||
|
||||
void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) {
|
||||
void Actor_UpdatePosByAnimation(Actor* actor, SkelAnime* skelAnime) {
|
||||
Vec3f sp1C;
|
||||
|
||||
SkelAnime_UpdateTranslation(skelAnime, &sp1C, actor->shape.rot.y);
|
||||
@@ -1345,20 +1345,20 @@ f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) {
|
||||
return Math_Vec3f_DistXZ(&actor->world.pos, refPoint);
|
||||
}
|
||||
|
||||
void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) {
|
||||
f32 cosRot2Y;
|
||||
f32 sinRot2Y;
|
||||
void Actor_WorldToActorCoords(Actor* actor, Vec3f* dest, Vec3f* pos) {
|
||||
f32 cosY;
|
||||
f32 sinY;
|
||||
f32 deltaX;
|
||||
f32 deltaZ;
|
||||
|
||||
cosRot2Y = Math_CosS(actor->shape.rot.y);
|
||||
sinRot2Y = Math_SinS(actor->shape.rot.y);
|
||||
deltaX = arg2->x - actor->world.pos.x;
|
||||
deltaZ = arg2->z - actor->world.pos.z;
|
||||
cosY = Math_CosS(actor->shape.rot.y);
|
||||
sinY = Math_SinS(actor->shape.rot.y);
|
||||
deltaX = pos->x - actor->world.pos.x;
|
||||
deltaZ = pos->z - actor->world.pos.z;
|
||||
|
||||
result->x = (deltaX * cosRot2Y) - (deltaZ * sinRot2Y);
|
||||
result->z = (deltaX * sinRot2Y) + (deltaZ * cosRot2Y);
|
||||
result->y = arg2->y - actor->world.pos.y;
|
||||
dest->x = (deltaX * cosY) - (deltaZ * sinY);
|
||||
dest->z = (deltaX * sinY) + (deltaZ * cosY);
|
||||
dest->y = pos->y - actor->world.pos.y;
|
||||
}
|
||||
|
||||
f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) {
|
||||
@@ -4603,7 +4603,7 @@ s32 func_80035124(Actor* actor, PlayState* play) {
|
||||
if (Actor_HasParent(actor, play)) {
|
||||
actor->params = 1;
|
||||
} else if (!(actor->bgCheckFlags & 1)) {
|
||||
Actor_MoveForward(actor);
|
||||
Actor_MoveXZGravity(actor);
|
||||
Math_SmoothStepToF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f);
|
||||
} else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f)) {
|
||||
ret = 1;
|
||||
|
||||
@@ -322,7 +322,7 @@ void EnAObj_Update(Actor* thisx, PlayState* play) {
|
||||
EnAObj* this = (EnAObj*)thisx;
|
||||
|
||||
this->actionFunc(this, play);
|
||||
Actor_MoveForward(&this->dyna.actor);
|
||||
Actor_MoveXZGravity(&this->dyna.actor);
|
||||
|
||||
if (this->dyna.actor.gravity != 0.0f) {
|
||||
if (this->dyna.actor.params != A_OBJ_BOULDER_FRAGMENT) {
|
||||
|
||||
@@ -831,7 +831,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
} else {
|
||||
sp3A = 1;
|
||||
Actor_MoveForward(&this->actor);
|
||||
Actor_MoveXZGravity(&this->actor);
|
||||
}
|
||||
|
||||
if (sp3A || D_80157D94[0]) {
|
||||
|
||||
Reference in New Issue
Block a user