mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-19 05:15:18 +00:00
Move binang utility macros out of angle conversion macros block
This commit is contained in:
parent
a9084ad65e
commit
385fbf6dfa
1 changed files with 4 additions and 3 deletions
|
@ -76,6 +76,9 @@ typedef struct {
|
|||
/* 0x06 */ s16 yaw; // azimuthal angle
|
||||
} VecSph; // size = 0x08
|
||||
|
||||
#define BINANG_ROT180(angle) ((s16)((angle) - 0x7FFF))
|
||||
#define BINANG_SUB(a, b) ((s16)((a) - (b)))
|
||||
|
||||
#define LERP(x, y, scale) (((y) - (x)) * (scale) + (x))
|
||||
#define LERP32(x, y, scale) ((s32)(((y) - (x)) * (scale)) + (x))
|
||||
#define LERP16(x, y, scale) ((s16)(((y) - (x)) * (scale)) + (x))
|
||||
|
@ -93,12 +96,10 @@ typedef struct {
|
|||
|
||||
#define IS_ZERO(f) (fabsf(f) < 0.008f)
|
||||
|
||||
// Trig macros
|
||||
// Angle conversion macros
|
||||
#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 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) * (M_PI / 0x8000))
|
||||
|
|
Loading…
Add table
Reference in a new issue