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:
parent
aab5bc9211
commit
61b864a89c
45 changed files with 120 additions and 128 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue