mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Renamed constants to new style.
This commit is contained in:
@@ -26,7 +26,7 @@ namespace bx
|
||||
void debugPrintfData(const void* _data, uint32_t _size, const char* _format, ...);
|
||||
|
||||
///
|
||||
class WriterI* getDebugOut();
|
||||
struct WriterI* getDebugOut();
|
||||
|
||||
} // namespace bx
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
|
||||
namespace bx
|
||||
{
|
||||
extern const float pi;
|
||||
extern const float invPi;
|
||||
extern const float piHalf;
|
||||
extern const float sqrt2;
|
||||
extern const float invLogNat2;
|
||||
extern const float huge;
|
||||
extern const float kPi;
|
||||
extern const float kPi2;
|
||||
extern const float kInvPi;
|
||||
extern const float kPiHalf;
|
||||
extern const float kSqrt2;
|
||||
extern const float kInvLogNat2;
|
||||
extern const float kHuge;
|
||||
|
||||
///
|
||||
typedef float (*LerpFn)(float _a, float _b, float _t);
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace bx
|
||||
|
||||
inline float easeInSine(float _t)
|
||||
{
|
||||
return 1.0f - fcos(_t*piHalf);
|
||||
return 1.0f - fcos(_t*kPiHalf);
|
||||
}
|
||||
|
||||
inline float easeOutSine(float _t)
|
||||
@@ -171,7 +171,7 @@ namespace bx
|
||||
|
||||
inline float easeOutElastic(float _t)
|
||||
{
|
||||
return fpow(2.0f, -10.0f*_t)*fsin( (_t-0.3f/4.0f)*(2.0f*pi)/0.3f) + 1.0f;
|
||||
return fpow(2.0f, -10.0f*_t)*fsin( (_t-0.3f/4.0f)*(2.0f*kPi)/0.3f) + 1.0f;
|
||||
}
|
||||
|
||||
inline float easeInElastic(float _t)
|
||||
@@ -191,7 +191,7 @@ namespace bx
|
||||
|
||||
inline float easeInBack(float _t)
|
||||
{
|
||||
return easeInCubic(_t) - _t*fsin(_t*pi);
|
||||
return easeInCubic(_t) - _t*fsin(_t*kPi);
|
||||
}
|
||||
|
||||
inline float easeOutBack(float _t)
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace bx
|
||||
{
|
||||
inline float toRad(float _deg)
|
||||
{
|
||||
return _deg * pi / 180.0f;
|
||||
return _deg * kPi / 180.0f;
|
||||
}
|
||||
|
||||
inline float toDeg(float _rad)
|
||||
{
|
||||
return _rad * 180.0f / pi;
|
||||
return _rad * 180.0f / kPi;
|
||||
}
|
||||
|
||||
inline uint32_t floatToBits(float _a)
|
||||
@@ -138,7 +138,7 @@ namespace bx
|
||||
|
||||
inline float flog2(float _a)
|
||||
{
|
||||
return flog(_a) * invLogNat2;
|
||||
return flog(_a) * kInvLogNat2;
|
||||
}
|
||||
|
||||
inline float frsqrt(float _a)
|
||||
@@ -208,8 +208,8 @@ namespace bx
|
||||
|
||||
inline float angleDiff(float _a, float _b)
|
||||
{
|
||||
const float dist = fwrap(_b - _a, pi*2.0f);
|
||||
return fwrap(dist*2.0f, pi*2.0f) - dist;
|
||||
const float dist = fwrap(_b - _a, kPi*2.0f);
|
||||
return fwrap(dist*2.0f, kPi*2.0f) - dist;
|
||||
}
|
||||
|
||||
inline float angleLerp(float _a, float _b, float _t)
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace bx
|
||||
template <typename Rng>
|
||||
inline void randUnitCircle(float _result[3], Rng* _rng)
|
||||
{
|
||||
const float angle = frnd(_rng) * pi * 2.0f;
|
||||
const float angle = frnd(_rng) * kPi2;
|
||||
|
||||
_result[0] = fcos(angle);
|
||||
_result[1] = 0.0f;
|
||||
@@ -92,7 +92,7 @@ namespace bx
|
||||
inline void randUnitSphere(float _result[3], Rng* _rng)
|
||||
{
|
||||
const float rand0 = frnd(_rng) * 2.0f - 1.0f;
|
||||
const float rand1 = frnd(_rng) * pi * 2.0f;
|
||||
const float rand1 = frnd(_rng) * kPi2;
|
||||
const float sqrtf1 = fsqrt(1.0f - rand0*rand0);
|
||||
|
||||
_result[0] = sqrtf1 * fcos(rand1);
|
||||
@@ -140,7 +140,7 @@ namespace bx
|
||||
tt = 2.0f * tt - 1.0f;
|
||||
|
||||
const float phi = (ii + 0.5f) / _num;
|
||||
const float phirad = phi * 2.0f * pi;
|
||||
const float phirad = phi * kPi2;
|
||||
const float st = fsqrt(1.0f-tt*tt) * _scale;
|
||||
|
||||
float* xyz = (float*)data;
|
||||
|
||||
Reference in New Issue
Block a user