1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-20 05:51:18 +00:00

Doc Actor Rotation Functions (last 4 funcs in actor.c) (#1249)

* Cleanup functions

* Rename functions

* functions comments

* fix apostrophes

* Renames TurnTo -> Track, other review comments
This commit is contained in:
Derek Hensley 2022-06-03 11:29:23 -07:00 committed by GitHub
parent 451b24f79b
commit b2752a6a2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 97 additions and 73 deletions

View file

@ -98,7 +98,7 @@ void EnGe3_TurnToFacePlayer(EnGe3* this, PlayState* play) {
if (ABS(angleDiff) <= 0x4000) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 6, 4000, 100);
this->actor.world.rot.y = this->actor.shape.rot.y;
func_80038290(play, &this->actor, &this->headRot, &this->unk_306, this->actor.focus.pos);
Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->unk_306, this->actor.focus.pos);
} else {
if (angleDiff < 0) {
Math_SmoothStepToS(&this->headRot.y, -0x2000, 6, 6200, 0x100);
@ -114,7 +114,7 @@ void EnGe3_TurnToFacePlayer(EnGe3* this, PlayState* play) {
void EnGe3_LookAtPlayer(EnGe3* this, PlayState* play) {
if ((ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x2300) &&
(this->actor.xzDistToPlayer < 100.0f)) {
func_80038290(play, &this->actor, &this->headRot, &this->unk_306, this->actor.focus.pos);
Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->unk_306, this->actor.focus.pos);
} else {
Math_SmoothStepToS(&this->headRot.x, 0, 6, 6200, 100);
Math_SmoothStepToS(&this->headRot.y, 0, 6, 6200, 100);