1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-16 12:02:50 +00:00

Angle cleanup - RADF_TO_BINANG (#1155)

* Run formatter

* Touch up angle macros (parentheses and hex constants)

* Use `RADF_TO_BINANG` more
This commit is contained in:
Dragorn421 2022-03-13 19:46:46 +01:00 committed by GitHub
parent aab5bc9211
commit 61b864a89c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 120 additions and 128 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 = Math_Atan2F(endPos.z - startPos.z, -(endPos.x - startPos.x)) * (0x8000 / M_PI);
this->jewelCsRotation.x = RADF_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 = Math_FAtan2F(x, z) * (32768.0f / M_PI);
this->actor.shape.rot.x = Math_FAtan2F(-(endPos.y - startPos.y), xzDistance) * (32768.0f / M_PI);
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));
}
/**