Fix last two functions in sys_math_atan (#1066)

* Fix extra Atan2 funcs

* format

* make Math_GetAtan2Tbl private

* rename Depr to XY

* ./format.sh i loathe thee

* namefixer.py changes
This commit is contained in:
mzxrules
2022-11-07 19:21:51 -05:00
committed by GitHub
parent 65cf949bc0
commit 577a4a772b
39 changed files with 133 additions and 131 deletions
+4 -4
View File
@@ -1072,8 +1072,8 @@ s32 SubS_TrackPoint(Vec3f* target, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trac
s16 targetX;
f32 diffZ = target->z - focusPos->z;
yaw = Math_FAtan2F(diffZ, diffX);
pitch = Math_FAtan2F(sqrtf(SQ(diffX) + SQ(diffZ)), target->y - focusPos->y);
yaw = Math_Atan2S_XY(diffZ, diffX);
pitch = Math_Atan2S_XY(sqrtf(SQ(diffX) + SQ(diffZ)), target->y - focusPos->y);
Math_SmoothStepToS(&trackTarget->x, pitch, 4, 0x2710, 0);
Math_SmoothStepToS(&trackTarget->y, yaw, 4, 0x2710, 0);
@@ -1306,8 +1306,8 @@ void SubS_ActorPathing_ComputePointInfo(PlayState* play, ActorPathing* actorPath
diff.z = actorPath->curPoint.z - actorPath->worldPos->z;
actorPath->distSqToCurPointXZ = Math3D_XZLengthSquared(diff.x, diff.z);
actorPath->distSqToCurPoint = Math3D_LengthSquared(&diff);
actorPath->rotToCurPoint.y = Math_FAtan2F(diff.z, diff.x);
actorPath->rotToCurPoint.x = Math_FAtan2F(sqrtf(actorPath->distSqToCurPointXZ), -diff.y);
actorPath->rotToCurPoint.y = Math_Atan2S_XY(diff.z, diff.x);
actorPath->rotToCurPoint.x = Math_Atan2S_XY(sqrtf(actorPath->distSqToCurPointXZ), -diff.y);
actorPath->rotToCurPoint.z = 0;
}