66#define orxLERP(A, B, T) ((A) + ((T) * ((B) - (A))))
76#define orxREMAP(A1, B1, A2, B2, V) (((V) - (A1)) / ((B1) - (A1)) * ((B2) - (A2)) + (A2))
83#define orxMIN(A, B) (((A) > (B)) ? (B) : (A))
90#define orxMAX(A, B) (((A) < (B)) ? (B) : (A))
98#define orxCLAMP(V, MIN, MAX) orxMAX(orxMIN(V, MAX), MIN)
104#define orxF2U(V) ((orxU32) (V))
110#define orxF2S(V) ((orxS32) (V))
116#define orxU2F(V) ((orxFLOAT)(V))
122#define orxS2F(V) ((orxFLOAT)(V))
231 u32Result = __popcnt(_u32Value);
236 u32Result = (orxU32)__builtin_popcount(_u32Value);
258 _BitScanForward((
unsigned long *)&u32Result, _u32Value);
263 u32Result = (orxU32)__builtin_ctz(_u32Value);
287 _BitScanForward64((
unsigned long *)&u32Result, _u64Value);
299 u32Result = (orxU32)__builtin_ctzll(_u64Value);
334 u32Result = _u32Value - 1;
335 u32Result = u32Result | (u32Result >> 1);
336 u32Result = u32Result | (u32Result >> 2);
337 u32Result = u32Result | (u32Result >> 4);
338 u32Result = u32Result | (u32Result >> 8);
339 u32Result = u32Result | (u32Result >> 16);
360 orxFLOAT fTemp, fResult;
363 fTemp = (_fValue - _fMin) / (_fMax - _fMin);
367 fResult = fTemp * fTemp * (orx2F(3.0f) - (orx2F(2.0f) * fTemp));
381 orxFLOAT fTemp, fResult;
384 fTemp = (_fValue - _fMin) / (_fMax - _fMin);
388 fResult = fTemp * fTemp * fTemp * (fTemp * ((fTemp * orx2F(6.0f)) - orx2F(15.0f)) + orx2F(10.0f));
397#define orxMATH_KF_SQRT_2 orx2F(1.414213562f)
398#define orxMATH_KF_EPSILON orx2F(0.0001f)
399#define orxMATH_KF_TINY_EPSILON orx2F(1.0e-037f)
400#define orxMATH_KF_MAX orx2F(3.402823466e+38F)
401#define orxMATH_KF_2_PI orx2F(6.283185307f)
402#define orxMATH_KF_PI orx2F(3.141592654f)
403#define orxMATH_KF_PI_BY_2 orx2F(1.570796327f)
404#define orxMATH_KF_PI_BY_4 orx2F(0.785398163f)
405#define orxMATH_KF_DEG_TO_RAD orx2F(3.141592654f / 180.0f)
406#define orxMATH_KF_RAD_TO_DEG orx2F(180.0f / 3.141592654f)
420 fResult = sinf(_fOp);
435 fResult = cosf(_fOp);
450 fResult = tanf(_fOp);
465 fResult = acosf(_fOp);
480 fResult = asinf(_fOp);
496 fResult = atan2f(_fOp1, _fOp2);
514 fResult = sqrtf(_fOp);
529 fResult = floorf(_fOp);
544 fResult = ceilf(_fOp);
561 fResult = floorf(_fOp + orx2F(0.5f));
566 fResult = rintf(_fOp);
579static orxINLINE orxFLOAT
orxMath_Mod(orxFLOAT _fOp1, orxFLOAT _fOp2)
584 fResult = fmodf(_fOp1, _fOp2);
595static orxINLINE orxFLOAT
orxMath_Pow(orxFLOAT _fOp, orxFLOAT _fExp)
600 fResult = powf(_fOp, _fExp);
615 fResult = fabsf(_fOp);
#define orxASSERT(TEST,...)
orxDLLAPI orxU64 orxFASTCALL orxMath_GetRandomU64(orxU64 _u64Min, orxU64 _u64Max)
static orxINLINE orxFLOAT orxMath_Floor(orxFLOAT _fOp)
orxDLLAPI orxU64 orxFASTCALL orxMath_GetSteppedRandomU64(orxU64 _u64Min, orxU64 _u64Max, orxU64 _u64Step)
orxDLLAPI orxS32 orxFASTCALL orxMath_GetSteppedRandomS32(orxS32 _s32Min, orxS32 _s32Max, orxS32 _s32Step)
static orxINLINE orxU32 orxMath_GetNextPowerOfTwo(orxU32 _u32Value)
orxDLLAPI orxS32 orxFASTCALL orxMath_GetRandomS32(orxS32 _s32Min, orxS32 _s32Max)
orxDLLAPI orxU32 orxFASTCALL orxMath_GetRandomU32(orxU32 _u32Min, orxU32 _u32Max)
orxDLLAPI void orxFASTCALL orxMath_SetRandomSeeds(const orxU32 _au32Seeds[4])
orxDLLAPI orxFLOAT orxFASTCALL orxMath_GetRandomFloat(orxFLOAT _fMin, orxFLOAT _fMax)
static orxINLINE orxFLOAT orxMath_Mod(orxFLOAT _fOp1, orxFLOAT _fOp2)
static orxINLINE orxFLOAT orxMath_Tan(orxFLOAT _fOp)
static orxINLINE orxFLOAT orxMath_Cos(orxFLOAT _fOp)
static orxINLINE orxFLOAT orxMath_ATan(orxFLOAT _fOp1, orxFLOAT _fOp2)
orxDLLAPI orxU32 orxFASTCALL orxMath_GetSteppedRandomU32(orxU32 _u32Min, orxU32 _u32Max, orxU32 _u32Step)
orxDLLAPI orxS64 orxFASTCALL orxMath_GetRandomS64(orxS64 _s64Min, orxS64 _s64Max)
static orxINLINE orxFLOAT orxMath_SmootherStep(orxFLOAT _fMin, orxFLOAT _fMax, orxFLOAT _fValue)
orxDLLAPI void orxFASTCALL orxMath_InitRandom(orxU32 _u32Seed)
static orxINLINE orxFLOAT orxMath_Abs(orxFLOAT _fOp)
static orxINLINE orxFLOAT orxMath_SmoothStep(orxFLOAT _fMin, orxFLOAT _fMax, orxFLOAT _fValue)
static orxINLINE orxFLOAT orxMath_Pow(orxFLOAT _fOp, orxFLOAT _fExp)
static orxINLINE orxFLOAT orxMath_ASin(orxFLOAT _fOp)
static orxINLINE orxFLOAT orxMath_ACos(orxFLOAT _fOp)
static orxINLINE orxFLOAT orxMath_Round(orxFLOAT _fOp)
static orxINLINE orxU32 orxMath_GetBitCount(orxU32 _u32Value)
static orxINLINE orxFLOAT orxMath_Ceil(orxFLOAT _fOp)
static orxINLINE orxU32 orxMath_GetTrailingZeroCount(orxU32 _u32Value)
orxDLLAPI void orxFASTCALL orxMath_GetRandomSeeds(orxU32 _au32Seeds[4])
static orxINLINE orxFLOAT orxMath_Sqrt(orxFLOAT _fOp)
#define orxCLAMP(V, MIN, MAX)
static orxINLINE orxFLOAT orxMath_Sin(orxFLOAT _fOp)
orxDLLAPI orxS64 orxFASTCALL orxMath_GetSteppedRandomS64(orxS64 _s64Min, orxS64 _s64Max, orxS64 _s64Step)
orxDLLAPI orxFLOAT orxFASTCALL orxMath_GetSteppedRandomFloat(orxFLOAT _fMin, orxFLOAT _fMax, orxFLOAT _fStep)
static orxINLINE orxU32 orxMath_GetTrailingZeroCount64(orxU64 _u64Value)
static orxINLINE orxBOOL orxMath_IsPowerOfTwo(orxU32 _u32Value)
static const orxFLOAT orxFLOAT_1
static const orxFLOAT orxFLOAT_0