Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed May 1, 2024
1 parent 74bda7e commit c5876a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion include/bx/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ namespace bx
/// The ratio of a circle's circumference to its radius. Pi multiplied by 2, or Tau. pi*2
constexpr float kPi2 = 6.2831853071795864769252867665590f;

/// The reciprocal of pi. 1/pi
/// The reciprocal of kPi. 1/kPi
constexpr float kInvPi = 1.0f/kPi;

/// The reciprocal of kPi2. 1/kPi2
constexpr float kInvPi2 = 1.0f/kPi2;

/// Pi divided by two. pi/2
constexpr float kPiHalf = 1.5707963267948966192313216916398f;

Expand Down
2 changes: 1 addition & 1 deletion include/bx/inline/math.inl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace bx

inline void sinCosApprox(float _a, float* _outSin, float* _outCos)
{
const float aa = _a - floor(_a/kPi2)*kPi2;
const float aa = _a - floor(_a*kInvPi2)*kPi2;
const float absA = abs(aa);
const float cosA = cos(absA);
const float cosASq = square(cosA);
Expand Down

0 comments on commit c5876a7

Please sign in to comment.