2021-03-28 22:49:05 +02:00
|
|
|
#ifndef C_MATH_H
|
|
|
|
|
#define C_MATH_H
|
|
|
|
|
|
2021-06-02 14:13:31 +02:00
|
|
|
#include "JSystem/JMath/JMATrigonometric.h"
|
2021-03-28 22:49:05 +02:00
|
|
|
#include "dolphin/types.h"
|
|
|
|
|
|
2023-07-16 23:44:23 -07:00
|
|
|
s16 cM_rad2s(float rad);
|
2021-03-30 02:45:32 +02:00
|
|
|
u16 U_GetAtanTable(float, float);
|
2023-07-16 23:44:23 -07:00
|
|
|
s16 cM_atan2s(float y, float x);
|
|
|
|
|
float cM_atan2f(float y, float x);
|
2021-03-30 02:45:32 +02:00
|
|
|
void cM_initRnd(int, int, int);
|
|
|
|
|
float cM_rnd(void);
|
|
|
|
|
float cM_rndF(float);
|
|
|
|
|
float cM_rndFX(float);
|
|
|
|
|
void cM_initRnd2(int, int, int);
|
|
|
|
|
float cM_rnd2(void);
|
|
|
|
|
float cM_rndF2(float);
|
|
|
|
|
float cM_rndFX2(float);
|
|
|
|
|
|
2023-07-16 23:44:23 -07:00
|
|
|
inline f32 cM_scos(s16 x) {
|
|
|
|
|
return JMASCos(x);
|
2021-06-02 14:13:31 +02:00
|
|
|
}
|
|
|
|
|
|
2023-07-16 23:44:23 -07:00
|
|
|
inline f32 cM_ssin(s16 x) {
|
|
|
|
|
return JMASSin(x);
|
2021-06-02 14:13:31 +02:00
|
|
|
}
|
|
|
|
|
|
2023-07-16 23:44:23 -07:00
|
|
|
inline s16 cM_deg2s(f32 deg) {
|
|
|
|
|
return deg * 182.04445f;
|
2021-12-21 06:06:57 -08:00
|
|
|
}
|
|
|
|
|
|
2023-07-16 23:44:23 -07:00
|
|
|
inline s16 i_cM_deg2s(f32 deg) {
|
|
|
|
|
return deg;
|
2023-03-17 21:05:06 -06:00
|
|
|
}
|
|
|
|
|
|
2023-08-03 23:13:13 +02:00
|
|
|
inline f32 cM_fcos(f32 x) {
|
|
|
|
|
return JMASCos(cM_rad2s(x));
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-16 23:44:23 -07:00
|
|
|
inline f32 cM_fsin(f32 x) {
|
|
|
|
|
return JMASSin(cM_rad2s(x));
|
2022-12-19 11:06:32 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline f32 cM_sht2d(f32 v) {
|
|
|
|
|
return v * 0.005493164f;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-28 22:49:05 +02:00
|
|
|
#endif /* C_MATH_H */
|