Recast: move DT_PI constant to DetourMath.h

DT_PI is used in many places, and each implementation defines its own with the same value. This is the start to factor that into 1 constant.
This commit is contained in:
Kawe Mazidjatari 2024-07-02 14:12:11 +02:00
parent 79e4e5b51f
commit 105e48693a
2 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,9 @@ Members in this module are wrappers around the standard math library
// if cmath is included before math.h.
#include <cmath>
/// The value of PI used by Recast.
static const float DT_PI = 3.14159265f;
inline float dtMathFabsf(float x) { return fabsf(x); }
inline float dtMathSqrtf(float x) { return sqrtf(x); }
inline float dtMathFloorf(float x) { return floorf(x); }

View File

@ -25,8 +25,6 @@
#include <float.h>
#include <new>
static const float DT_PI = 3.14159265f;
static int sweepCircleCircle(const float* c0, const float r0, const float* v,
const float* c1, const float r1,
float& tmin, float& tmax)