Angle cleanup - miscellaneous (#1159)

* Add `BINANG_TO_RAD_ALT2`

* Few hex constants in place of decimal cardinal angles

* Use `BINANG_TO_DEGF` more

* Use `DEG_TO_RAD(int)` for angle literals

* `BINANG_TO_RAD_ALT(literal)` -> use `BINANG_TO_RAD`

* Somewhat arbitrary literal angles cleanup
This commit is contained in:
Dragorn421
2022-04-03 20:32:18 +02:00
committed by GitHub
parent 791d9018c0
commit 3ce701cfd8
13 changed files with 36 additions and 34 deletions
+1
View File
@@ -103,6 +103,7 @@ typedef struct {
#define BINANG_TO_DEGF(binang) ((f32)(binang) * (360.0001525f / 65535.0f))
#define BINANG_TO_RAD(binang) ((f32)(binang) * (M_PI / 0x8000))
#define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / (f32)0x8000) * M_PI)
#define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * M_PI) / 0x8000)
// Vector macros
#define SQXZ(vec) ((vec.x) * (vec.x) + (vec.z) * (vec.z))