From 003c02e2be3f8367489402d2c4edfa357fbf8cd9 Mon Sep 17 00:00:00 2001 From: alessamothdream Date: Thu, 20 Aug 2026 22:55:05 -0700 Subject: [PATCH] add `MathUtil.h` --- src/cs4/Seimei/src/MathUtil.c | 1 + src/cs4/Seimei/src/MathUtil.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/cs4/Seimei/src/MathUtil.h diff --git a/src/cs4/Seimei/src/MathUtil.c b/src/cs4/Seimei/src/MathUtil.c index 35bc6cb..d0fe49a 100644 --- a/src/cs4/Seimei/src/MathUtil.c +++ b/src/cs4/Seimei/src/MathUtil.c @@ -1,4 +1,5 @@ #include "common.h" +#include "MathUtil.h" #define REVOLUTIONS(angle) (TWO_PI * (int) ((PI + angle) / TWO_PI)) diff --git a/src/cs4/Seimei/src/MathUtil.h b/src/cs4/Seimei/src/MathUtil.h new file mode 100644 index 0000000..5b3b75b --- /dev/null +++ b/src/cs4/Seimei/src/MathUtil.h @@ -0,0 +1,27 @@ +#ifndef MATH_UTIL_H +#define MATH_UTIL_H + +#include "typedefs.h" + +extern float V0[4]; +extern float V1[4]; +extern float VX[4]; +extern float VY[4]; +extern float VZ[4]; +extern float VW[4]; +extern float MRX1[4][4]; + +float Math_GetPosToAngle(float* pos1, float* pos2); +u_int Math_GotoVector2(float* now, float* end, float per, float min, float max); +u_int Math_GotoVector(float* now, float* end, float add); +u_int Math_GotoVectorXZ(float* now, float* end, float add); +float Math_GetAngleDist(float ang1, float ang2); +float Math_GetAngle360(float ang); +float Math_GetDistXZ(float* v1, float* v2); +float Math_GetDist2(float* v1, float* v2); +float Math_GetDist(float* v1, float* v2); +float Math_GotoAngle(float FromAngle, float ToAngle, float Rate); +void Math_VectorToAngleXY(float* Ang, float* Vec); +float Math_VectorToAngle(float xx, float zz); + +#endif // MATH_UTIL_H