1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-16 20:10:28 +00:00

Angle cleanup - macros names (#1193)

* Move binang utility macros out of angle conversion macros block

* `BINANG_TO_DEGF` -> `BINANG_TO_DEG_ALT` (it may even be warranted to name it _approx instead of _alt, unsure)

* Add `BINANG_TO_DEG` (unused by oot) (for completeness)

* `DEGF_TO_BINANG` -> `DEG_TO_BINANG_ALT` (again may even be _approx, or maybe _cam)

* Add `DEG_TO_BINANG` (unused by oot) (for completeness)

* `RADF_TO_BINANG` -> `RAD_TO_BINANG`

* `RADF_TO_DEGF` -> `RAD_TO_DEG`

* Cleanup argument names in angle conversion macros

* Format for angle macros changes

* Run formatter

* Move `DEG_TO_BINANG_ALT`, `BINANG_TO_DEG_ALT` to z64camera.h

* Remove `DEG_TO_BINANG`, `BINANG_TO_DEG`

* Remove `_ALT` from `DEG_TO_BINANG`, `BINANG_TO_DEG`

* Add comment about inaccuracy near `DEG_TO_BINANG`, `BINANG_TO_DEG`

* run formatter

* `CAM_` prefix on `DEG_TO_BINANG`, `BINANG_TO_DEG` macros

* Revert "Remove `DEG_TO_BINANG`, `BINANG_TO_DEG`"

This reverts commit 5321647e5b.
This commit is contained in:
Dragorn421 2022-04-24 16:23:49 +02:00 committed by GitHub
parent ef870bdd11
commit fed9ac3e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 219 additions and 213 deletions

View file

@ -1471,7 +1471,7 @@ void DemoEffect_MoveJewelActivateDoorOfTime(DemoEffect* this, GlobalContext* glo
}
if (startPos.x != endPos.x || startPos.y != endPos.y || startPos.z != endPos.z) {
this->jewelCsRotation.x = RADF_TO_BINANG(Math_Atan2F(endPos.z - startPos.z, -(endPos.x - startPos.x)));
this->jewelCsRotation.x = RAD_TO_BINANG(Math_Atan2F(endPos.z - startPos.z, -(endPos.x - startPos.x)));
this->jewelCsRotation.y = Math_Vec3f_Yaw(&startPos, &endPos);
}
@ -2093,8 +2093,8 @@ void DemoEffect_FaceToCsEndpoint(DemoEffect* this, Vec3f startPos, Vec3f endPos)
f32 z = endPos.z - startPos.z;
f32 xzDistance = sqrtf(SQ(x) + SQ(z));
this->actor.shape.rot.y = RADF_TO_BINANG(Math_FAtan2F(x, z));
this->actor.shape.rot.x = RADF_TO_BINANG(Math_FAtan2F(-(endPos.y - startPos.y), xzDistance));
this->actor.shape.rot.y = RAD_TO_BINANG(Math_FAtan2F(x, z));
this->actor.shape.rot.x = RAD_TO_BINANG(Math_FAtan2F(-(endPos.y - startPos.y), xzDistance));
}
/**