Skip to content

Commit d25f6bf

Browse files
committed
xrCore/math_constants.h: use constexpr
1 parent 422b48c commit d25f6bf

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/xrCore/math_constants.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@
1111

1212
// Constants
1313
// Epsilon's, to use as difference limit when comparing float's.
14-
const float EPS_S = 0.0000001f;
15-
const float EPS = 0.0000100f;
16-
const float EPS_L = 0.0010000f;
14+
constexpr float EPS_S = 0.0000001f;
15+
constexpr float EPS = 0.0000100f;
16+
constexpr float EPS_L = 0.0010000f;
1717

1818
#ifdef M_SQRT1_2
1919
#undef M_SQRT1_2
2020
#endif
2121
// XXX: The following section contains constants with a _tad_ many decimals to fit in a float. :-)
2222
// They used to be macro's, so they could be used as double too.
23-
const float M_SQRT1_2 = 0.7071067811865475244008443621048f;//490;
23+
constexpr float M_SQRT1_2 = 0.7071067811865475244008443621048f;//490;
2424

25-
const float M_PI = 3.1415926535897932384626433832795f;
26-
const float PI = 3.1415926535897932384626433832795f;
27-
const float PI_MUL_2 = 6.2831853071795864769252867665590f;
28-
const float PI_MUL_3 = 9.4247779607693797153879301498385f;
29-
const float PI_MUL_4 = 12.566370614359172953850573533118f;
30-
const float PI_MUL_6 = 18.849555921538759430775860299677f;
31-
const float PI_MUL_8 = 25.132741228718345907701147066236f;
32-
const float PI_DIV_2 = 1.5707963267948966192313216916398f;
33-
const float PI_DIV_3 = 1.0471975511965977461542144610932f;
34-
const float PI_DIV_4 = 0.7853981633974483096156608458199f;
35-
const float PI_DIV_6 = 0.5235987755982988730771072305466f;
36-
const float PI_DIV_8 = 0.3926990816987241548078304229099f;
25+
constexpr float M_PI = 3.1415926535897932384626433832795f;
26+
constexpr float PI = 3.1415926535897932384626433832795f;
27+
constexpr float PI_MUL_2 = 6.2831853071795864769252867665590f;
28+
constexpr float PI_MUL_3 = 9.4247779607693797153879301498385f;
29+
constexpr float PI_MUL_4 = 12.566370614359172953850573533118f;
30+
constexpr float PI_MUL_6 = 18.849555921538759430775860299677f;
31+
constexpr float PI_MUL_8 = 25.132741228718345907701147066236f;
32+
constexpr float PI_DIV_2 = 1.5707963267948966192313216916398f;
33+
constexpr float PI_DIV_3 = 1.0471975511965977461542144610932f;
34+
constexpr float PI_DIV_4 = 0.7853981633974483096156608458199f;
35+
constexpr float PI_DIV_6 = 0.5235987755982988730771072305466f;
36+
constexpr float PI_DIV_8 = 0.3926990816987241548078304229099f;

0 commit comments

Comments
 (0)