mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-05 07:24:34 +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
|
@ -94,15 +94,15 @@ typedef struct {
|
|||
#define IS_ZERO(f) (fabsf(f) < 0.008f)
|
||||
|
||||
// Trig macros
|
||||
#define DEGF_TO_BINANG(degreesf) (s16)(degreesf * 182.04167f + .5f)
|
||||
#define RADF_TO_BINANG(radf) (s16)(radf * (32768.0f / M_PI))
|
||||
#define RADF_TO_DEGF(radf) (radf * (180.0f / M_PI))
|
||||
#define DEGF_TO_RADF(degf) (degf * (M_PI / 180.0f))
|
||||
#define BINANG_ROT180(angle) ((s16)(angle - 0x7FFF))
|
||||
#define BINANG_SUB(a, b) ((s16)(a - b))
|
||||
#define DEGF_TO_BINANG(degreesf) (s16)((degreesf) * 182.04167f + .5f)
|
||||
#define RADF_TO_BINANG(radf) (s16)((radf) * (0x8000 / M_PI))
|
||||
#define RADF_TO_DEGF(radf) ((radf) * (180.0f / M_PI))
|
||||
#define DEGF_TO_RADF(degf) ((degf) * (M_PI / 180.0f))
|
||||
#define BINANG_ROT180(angle) ((s16)((angle) - 0x7FFF))
|
||||
#define BINANG_SUB(a, b) ((s16)((a) - (b)))
|
||||
#define DEG_TO_RAD(degrees) ((degrees) * (M_PI / 180.0f))
|
||||
#define BINANG_TO_DEGF(binang) ((f32)binang * (360.0001525f / 65535.0f))
|
||||
#define BINANG_TO_RAD(binang) (((f32)binang / 32768.0f) * M_PI)
|
||||
#define BINANG_TO_DEGF(binang) ((f32)(binang) * (360.0001525f / 65535.0f))
|
||||
#define BINANG_TO_RAD(binang) (((f32)(binang) / (f32)0x8000) * M_PI)
|
||||
|
||||
// Vector macros
|
||||
#define SQXZ(vec) ((vec.x) * (vec.x) + (vec.z) * (vec.z))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue