summaryrefslogtreecommitdiff
path: root/src/code/z_sub_s.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2024-06-15 15:39:31 +1000
committerGitHub <noreply@github.com>2024-06-14 22:39:31 -0700
commitb55f8ffe6e60ed2335acbe7d428049ea1056f4b5 (patch)
tree7aa56780d34acb286b92e829d401d5b2fa01bc65 /src/code/z_sub_s.c
parent3705eaedac1d21318ee708993d366b30cdc0e8ad (diff)
`sys_math3d.c` Decompiled and Mostly Documented (#1450)
* Use matched sys_math3d functions by Tharo Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * kinda match some unattempted functions * move sys_math3d function declarations to z64math.h * Rename some simple functions * Take matched Math3D_LineVsLineClosestTwoPoints from OoT * minor fixes to make stuff actually equivalent * func_8017FB1C * format * minor cleanup * Math3D_PointOnDirectedLine * func_8017FB1C documentation Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * Remove actorfixer * fix merge * Apply renames * more cleanup * bss cleanup * match Math3D_CylVsLineSeg * WIP * OK * small cleanup * Remove macros.h from sys_math3d * Small cleanup * Some more small clean up * cleanup and docs * cleanup * PR Review * cleanup * fix merge * fix merge * merge main * fix bss * bss * fix * PR Review * bss fix * Merge main * Fix bss * Fix merge * Add zero vecs to sys_math3d * Format * namefixer run --------- Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Diffstat (limited to 'src/code/z_sub_s.c')
-rw-r--r--src/code/z_sub_s.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c
index 11f97c7d0..a7e4adfc8 100644
--- a/src/code/z_sub_s.c
+++ b/src/code/z_sub_s.c
@@ -578,7 +578,7 @@ s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
diffZ = points[index + 1].z - points[index - 1].z;
}
- func_8017B7F8(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
+ Math3D_RotateXZPlane(&point, RAD_TO_BINANG(Math_FAtan2F(diffX, diffZ)), &px, &pz, &d);
if (((px * actor->world.pos.x) + (pz * actor->world.pos.z) + d) > 0.0f) {
reached = true;
@@ -1328,8 +1328,8 @@ void SubS_ActorPathing_ComputePointInfo(PlayState* play, ActorPathing* actorPath
diff.x = actorPath->curPoint.x - actorPath->worldPos->x;
diff.y = actorPath->curPoint.y - actorPath->worldPos->y;
diff.z = actorPath->curPoint.z - actorPath->worldPos->z;
- actorPath->distSqToCurPointXZ = Math3D_XZLengthSquared(diff.x, diff.z);
- actorPath->distSqToCurPoint = Math3D_LengthSquared(&diff);
+ actorPath->distSqToCurPointXZ = Math3D_Dist1DSq(diff.x, diff.z);
+ actorPath->distSqToCurPoint = Math3D_Vec3fMagnitudeSq(&diff);
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;