2022-09-05 04:00:04 +00:00
|
|
|
#ifndef _CMATH_HPP
|
|
|
|
#define _CMATH_HPP
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-09-21 05:18:07 +00:00
|
|
|
#define M_PIF 3.14159265358979323846f
|
|
|
|
|
2022-09-05 04:00:04 +00:00
|
|
|
class CMath {
|
|
|
|
public:
|
|
|
|
static f32 FastCosR(f32 v);
|
|
|
|
static f32 FastSinR(f32 v);
|
|
|
|
static inline f32 FastFmod(f32 x, f32 y) {
|
2022-09-13 04:26:54 +00:00
|
|
|
int v = static_cast< int >(x * (1.f / y));
|
2022-09-05 04:00:04 +00:00
|
|
|
return x - v * y;
|
|
|
|
}
|
2022-09-13 04:26:54 +00:00
|
|
|
template < typename T >
|
|
|
|
static const T& Clamp(const T& min, const T& val, const T& max);
|
|
|
|
// ClampRadians__5CMathFf
|
2022-09-21 05:18:07 +00:00
|
|
|
static f32 SqrtF(f32 v);
|
2022-09-05 04:00:04 +00:00
|
|
|
};
|
|
|
|
|
2022-09-13 04:52:59 +00:00
|
|
|
#endif
|