CScriptSpecialFunction progress & symbol updates

Former-commit-id: 84d590be2f
This commit is contained in:
2022-10-04 20:16:03 -04:00
parent c8528fc2ee
commit e7ecda7a36
20 changed files with 234 additions and 152 deletions

View File

@@ -8,9 +8,21 @@
#include "math.h"
static bool close_enough(const CVector2f& a, const CVector2f& b, f32 epsilon = 0.001f);
static bool close_enough(const CVector3f& a, const CVector3f& b, f32 epsilon = 0.001f);
inline bool close_enough(float a, float b, f32 epsilon = 0.001f) {
struct Real32 {
static inline float Epsilon() { return FLT_EPSILON; }
};
struct Double {
static inline double Epsilon() { return DBL_EPSILON; }
};
static inline float vector3_epsilon() { return FLT_EPSILON; }
static inline float vector2_epsilon() { return FLT_EPSILON; }
static bool close_enough(const CVector2f& a, const CVector2f& b, float epsilon = vector2_epsilon());
static bool close_enough(const CVector3f& a, const CVector3f& b, float epsilon = vector3_epsilon());
inline bool close_enough(float a, float b, float epsilon = Real32::Epsilon()) {
return fabs(a - b) < epsilon;
}
inline bool close_enough(double a, double b, double epsilon = Double::Epsilon()) {
return fabs(a - b) < epsilon;
}