Finish e3setup/main.c

Also add ext_math.h file for better math
This commit is contained in:
gamemasterplc 2024-04-23 17:05:53 -05:00
parent da91a21183
commit 1e83c979fb
4 changed files with 1251 additions and 75 deletions

21
include/ext_math.h Normal file
View file

@ -0,0 +1,21 @@
#ifndef _EXT_MATH_H
#define _EXT_MATH_H
#include "math.h"
#include "dolphin/mtx.h"
typedef struct vector2 {
float x;
float y;
} Vector2;
#define ABS(x) (((x) < 0) ? -(x) : (x))
#define VECDistanceXZ(a, b) sqrtf((((a)->x-(b)->x)*((a)->x-(b)->x))+(((a)->z-(b)->z)*((a)->z-(b)->z)))
#define VECMagXZ(a) sqrtf(((a)->x*(a)->x)+((a)->z*(a)->z))
#define sind(x) sin(M_PI*(x)/180.0)
#define cosd(x) cos(M_PI*(x)/180.0)
#define atan2d(y, x) (180.0*(atan2((y), (x)) / M_PI))
#endif