2022-04-16 07:50:32 +00:00
|
|
|
#ifndef __CLOSEENOUGH_HPP__
|
|
|
|
#define __CLOSEENOUGH_HPP__
|
|
|
|
|
2022-07-02 05:30:04 +00:00
|
|
|
#include "types.h"
|
2022-04-16 07:50:32 +00:00
|
|
|
|
2022-08-09 23:03:51 +00:00
|
|
|
#include "Kyoto/Math/CVector2f.hpp"
|
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
2022-07-02 05:30:04 +00:00
|
|
|
|
2022-10-03 11:55:03 +00:00
|
|
|
#include "math.h"
|
|
|
|
|
2022-07-02 05:30:04 +00:00
|
|
|
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);
|
2022-10-03 11:55:03 +00:00
|
|
|
inline bool close_enough(float a, float b, f32 epsilon = 0.001f) {
|
|
|
|
return fabs(a - b) < epsilon;
|
|
|
|
}
|
2022-04-16 07:50:32 +00:00
|
|
|
|
|
|
|
#endif // __CLOSEENOUGH_HPP__
|