From 3fbcddb4ef9840ff59e1328645e42cf1bc3a32e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 9 Jun 2017 20:08:52 -0700 Subject: [PATCH] Renamed constants to new style. --- examples/06-bump/bump.cpp | 4 +- examples/11-fontsdf/fontsdf.cpp | 2 +- examples/13-stencil/stencil.cpp | 6 +-- examples/14-shadowvolumes/shadowvolumes.cpp | 12 ++--- .../shadowmaps_simple.cpp | 2 +- examples/16-shadowmaps/shadowmaps.cpp | 4 +- examples/18-ibl/ibl.cpp | 10 ++-- examples/21-deferred/deferred.cpp | 8 ++-- examples/23-vectordisplay/main.cpp | 8 ++-- examples/23-vectordisplay/vectordisplay.cpp | 46 +++++++++---------- examples/27-terrain/terrain.cpp | 2 +- examples/28-wireframe/wireframe.cpp | 10 ++-- examples/31-rsm/reflectiveshadowmap.cpp | 4 +- examples/common/bounds.cpp | 2 +- examples/common/camera.cpp | 4 +- examples/common/debugdraw/debugdraw.cpp | 12 ++--- examples/common/imgui/imgui.cpp | 2 +- examples/common/ps/particle_system.cpp | 4 +- tools/texturev/texturev.cpp | 2 +- 19 files changed, 72 insertions(+), 72 deletions(-) diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index 398b3ded7..38b0689aa 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -224,8 +224,8 @@ class ExampleBump : public entry::AppI float lightPosRadius[4][4]; for (uint32_t ii = 0; ii < m_numLights; ++ii) { - lightPosRadius[ii][0] = bx::fsin( (time*(0.1f + ii*0.17f) + ii*bx::piHalf*1.37f ) )*3.0f; - lightPosRadius[ii][1] = bx::fcos( (time*(0.2f + ii*0.29f) + ii*bx::piHalf*1.49f ) )*3.0f; + lightPosRadius[ii][0] = bx::fsin( (time*(0.1f + ii*0.17f) + ii*bx::kPiHalf*1.37f ) )*3.0f; + lightPosRadius[ii][1] = bx::fcos( (time*(0.2f + ii*0.29f) + ii*bx::kPiHalf*1.49f ) )*3.0f; lightPosRadius[ii][2] = -2.5f; lightPosRadius[ii][3] = 3.0f; } diff --git a/examples/11-fontsdf/fontsdf.cpp b/examples/11-fontsdf/fontsdf.cpp index 01c6bd08b..4d9eea589 100644 --- a/examples/11-fontsdf/fontsdf.cpp +++ b/examples/11-fontsdf/fontsdf.cpp @@ -126,7 +126,7 @@ int _main_(int _argc, char** _argv) } recomputeVisibleText |= imguiSlider("Scroll", textScroll, 0.0f, (lineCount-visibleLineCount) , 1.0f); - imguiSlider("Rotate", textRotation, 0.0f, bx::pi*2.0f , 0.1f); + imguiSlider("Rotate", textRotation, 0.0f, bx::kPi*2.0f , 0.1f); recomputeVisibleText |= imguiSlider("Scale", textScale, 0.1f, 10.0f , 0.1f); if (recomputeVisibleText) diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index 7e1c1894c..de95d17ef 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -996,9 +996,9 @@ int _main_(int _argc, char** _argv) const float radius = (scene == StencilReflectionScene) ? 15.0f : 25.0f; for (uint8_t ii = 0; ii < numLights; ++ii) { - lightPosRadius[ii][0] = bx::fsin( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f; - lightPosRadius[ii][1] = 8.0f + (1.0f - bx::fcos( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ) )*4.0f; - lightPosRadius[ii][2] = bx::fcos( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f; + lightPosRadius[ii][0] = bx::fsin( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::kPiHalf*1.07f ) )*20.0f; + lightPosRadius[ii][1] = 8.0f + (1.0f - bx::fcos( (lightTimeAccumulator*1.5f + ii*0.29f + bx::kPiHalf*1.49f ) ) )*4.0f; + lightPosRadius[ii][2] = bx::fcos( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::kPiHalf*1.79f ) )*20.0f; lightPosRadius[ii][3] = radius; } bx::memCopy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float) ); diff --git a/examples/14-shadowvolumes/shadowvolumes.cpp b/examples/14-shadowvolumes/shadowvolumes.cpp index e301addfc..4e8e8a03f 100644 --- a/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/examples/14-shadowvolumes/shadowvolumes.cpp @@ -2231,9 +2231,9 @@ int _main_(int _argc, char** _argv) { for (uint8_t ii = 0; ii < settings_numLights; ++ii) { - lightPosRadius[ii][0] = bx::fcos(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; + lightPosRadius[ii][0] = bx::fcos(2.0f*bx::kPi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; lightPosRadius[ii][1] = 20.0f; - lightPosRadius[ii][2] = bx::fsin(2.0f*bx::pi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; + lightPosRadius[ii][2] = bx::fsin(2.0f*bx::kPi/settings_numLights * float(ii) + lightTimeAccumulator * 1.1f + 3.0f) * 20.0f; lightPosRadius[ii][3] = 20.0f; } } @@ -2241,9 +2241,9 @@ int _main_(int _argc, char** _argv) { for (uint8_t ii = 0; ii < settings_numLights; ++ii) { - lightPosRadius[ii][0] = bx::fcos(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; + lightPosRadius[ii][0] = bx::fcos(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::kPi) * 40.0f; lightPosRadius[ii][1] = 20.0f; - lightPosRadius[ii][2] = bx::fsin(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::pi) * 40.0f; + lightPosRadius[ii][2] = bx::fsin(float(ii) * 2.0f/settings_numLights + lightTimeAccumulator * 1.3f + bx::kPi) * 40.0f; lightPosRadius[ii][3] = 20.0f; } } @@ -2374,7 +2374,7 @@ int _main_(int _argc, char** _argv) inst.m_scale[0] = 21.0f; inst.m_scale[1] = 21.0f; inst.m_scale[2] = 21.0f; - inst.m_rotation[0] = bx::pi; + inst.m_rotation[0] = bx::kPi; inst.m_rotation[1] = 0.0f; inst.m_rotation[2] = 0.0f; inst.m_pos[0] = 0.0f; @@ -2441,7 +2441,7 @@ int _main_(int _argc, char** _argv) inst.m_scale[1] = 5.0f; inst.m_scale[2] = 5.0f; inst.m_rotation[0] = 0.0f; - inst.m_rotation[1] = bx::pi; + inst.m_rotation[1] = bx::kPi; inst.m_rotation[2] = 0.0f; inst.m_pos[0] = currX; inst.m_pos[1] = 0.0f; diff --git a/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index 34f3ec914..526f5bf48 100644 --- a/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -223,7 +223,7 @@ int _main_(int _argc, char** _argv) float mtxBunny[16]; bx::mtxSRT(mtxBunny , 5.0f, 5.0f, 5.0f - , 0.0f, bx::pi - timeAccumulatorScene, 0.0f + , 0.0f, bx::kPi - timeAccumulatorScene, 0.0f , 15.0f, 5.0f, 0.0f ); diff --git a/examples/16-shadowmaps/shadowmaps.cpp b/examples/16-shadowmaps/shadowmaps.cpp index a0d692861..f25df28a9 100644 --- a/examples/16-shadowmaps/shadowmaps.cpp +++ b/examples/16-shadowmaps/shadowmaps.cpp @@ -2220,9 +2220,9 @@ int _main_(int _argc, char** _argv) , 0.0f , float(ii) , 0.0f - , bx::fsin(float(ii)*2.0f*bx::pi/float(numTrees) ) * 60.0f + , bx::fsin(float(ii)*2.0f*bx::kPi/float(numTrees) ) * 60.0f , 0.0f - , bx::fcos(float(ii)*2.0f*bx::pi/float(numTrees) ) * 60.0f + , bx::fcos(float(ii)*2.0f*bx::kPi/float(numTrees) ) * 60.0f ); } diff --git a/examples/18-ibl/ibl.cpp b/examples/18-ibl/ibl.cpp index b4016d519..70d0b4591 100644 --- a/examples/18-ibl/ibl.cpp +++ b/examples/18-ibl/ibl.cpp @@ -350,8 +350,8 @@ struct Camera static inline void vecFromLatLong(float _vec[3], float _u, float _v) { - const float phi = _u * 2.0f*bx::pi; - const float theta = _v * bx::pi; + const float phi = _u * 2.0f*bx::kPi; + const float theta = _v * bx::kPi; const float st = bx::fsin(theta); const float sp = bx::fsin(phi); @@ -368,8 +368,8 @@ struct Camera const float phi = bx::fatan2(_vec[0], _vec[2]); const float theta = bx::facos(_vec[1]); - _u = (bx::pi + phi)*bx::invPi*0.5f; - _v = theta*bx::invPi; + _u = (bx::kPi + phi)*bx::kInvPi*0.5f; + _v = theta*bx::kInvPi; } struct Interp3f @@ -760,7 +760,7 @@ int _main_(int _argc, char** _argv) { // Submit bunny. float mtx[16]; - bx::mtxSRT(mtx, 1.0f, 1.0f, 1.0f, 0.0f, bx::pi, 0.0f, 0.0f, -0.80f, 0.0f); + bx::mtxSRT(mtx, 1.0f, 1.0f, 1.0f, 0.0f, bx::kPi, 0.0f, 0.0f, -0.80f, 0.0f); bgfx::setTexture(0, s_texCube, lightProbes[currentLightProbe].m_tex); bgfx::setTexture(1, s_texCubeIrr, lightProbes[currentLightProbe].m_texIrr); uniforms.submit(); diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index 37cdb3eba..9904a4a7e 100644 --- a/examples/21-deferred/deferred.cpp +++ b/examples/21-deferred/deferred.cpp @@ -538,10 +538,10 @@ class ExampleDeferred : public entry::AppI { Sphere lightPosRadius; - float lightTime = time * m_lightAnimationSpeed * (bx::fsin(light/float(m_numLights) * bx::piHalf ) * 0.5f + 0.5f); - lightPosRadius.m_center[0] = bx::fsin( ( (lightTime + light*0.47f) + bx::piHalf*1.37f ) )*offset; - lightPosRadius.m_center[1] = bx::fcos( ( (lightTime + light*0.69f) + bx::piHalf*1.49f ) )*offset; - lightPosRadius.m_center[2] = bx::fsin( ( (lightTime + light*0.37f) + bx::piHalf*1.57f ) )*2.0f; + float lightTime = time * m_lightAnimationSpeed * (bx::fsin(light/float(m_numLights) * bx::kPiHalf ) * 0.5f + 0.5f); + lightPosRadius.m_center[0] = bx::fsin( ( (lightTime + light*0.47f) + bx::kPiHalf*1.37f ) )*offset; + lightPosRadius.m_center[1] = bx::fcos( ( (lightTime + light*0.69f) + bx::kPiHalf*1.49f ) )*offset; + lightPosRadius.m_center[2] = bx::fsin( ( (lightTime + light*0.37f) + bx::kPiHalf*1.57f ) )*2.0f; lightPosRadius.m_radius = 2.0f; Aabb aabb; diff --git a/examples/23-vectordisplay/main.cpp b/examples/23-vectordisplay/main.cpp index 9a89d16ab..520fc27af 100644 --- a/examples/23-vectordisplay/main.cpp +++ b/examples/23-vectordisplay/main.cpp @@ -144,10 +144,10 @@ int _main_(int _argc, char** _argv) vd.drawBox(450.0f, 600.0f, 80.0f, 80.0f); vd.setDrawColor(1.0f, 0.7f, 1.0f); - vd.drawWheel(bx::pi, 800.0f, 450.0f, 80.0f); - vd.drawWheel(3.0f * bx::pi / 4.0f, 95.0f, 450.0f, 60.0f); - vd.drawWheel(bx::pi / 2.0f, 1150.0f, 450.0f, 30.0f); - vd.drawWheel(bx::pi / 4.0f, 1250.0f, 450.0f, 10.0f); + vd.drawWheel(bx::kPi, 800.0f, 450.0f, 80.0f); + vd.drawWheel(3.0f * bx::kPi / 4.0f, 95.0f, 450.0f, 60.0f); + vd.drawWheel(bx::kPi / 2.0f, 1150.0f, 450.0f, 30.0f); + vd.drawWheel(bx::kPi / 4.0f, 1250.0f, 450.0f, 10.0f); // draw moving shape static float counter = 0.0f; diff --git a/examples/23-vectordisplay/vectordisplay.cpp b/examples/23-vectordisplay/vectordisplay.cpp index fb72fa1b3..9b1450cf3 100644 --- a/examples/23-vectordisplay/vectordisplay.cpp +++ b/examples/23-vectordisplay/vectordisplay.cpp @@ -47,7 +47,7 @@ bgfx::VertexDecl PosColorUvVertex::ms_decl; inline float normalizef(float _a) { - return bx::fwrap(_a, 2.0f * bx::pi); + return bx::fwrap(_a, 2.0f * bx::kPi); } VectorDisplay::VectorDisplay(bool _originBottomLeft, float _texelHalf) @@ -368,12 +368,12 @@ void VectorDisplay::endDraw() float a2pa = normalizef(line->a - pline->a); float maxshorten = bx::fmin(line->len, pline->len) / 2.0f; - if (bx::fmin(a2pa, pa2a) <= (bx::pi / 2.0f + FLT_EPSILON) ) + if (bx::fmin(a2pa, pa2a) <= (bx::kPi / 2.0f + FLT_EPSILON) ) { if (a2pa < pa2a) { float shorten = t * bx::fsin(a2pa / 2.0f) / bx::fcos(a2pa / 2.0f); - float a = (bx::pi - a2pa) / 2.0f; + float a = (bx::kPi - a2pa) / 2.0f; if (shorten > maxshorten) { line->s0 = pline->s1 = maxshorten; @@ -389,7 +389,7 @@ void VectorDisplay::endDraw() else { float shorten = t * bx::fsin(pa2a / 2.0f) / bx::fcos(pa2a / 2.0f); - float a = (bx::pi - pa2a) / 2.0f; + float a = (bx::kPi - pa2a) / 2.0f; if (shorten > maxshorten) { line->s0 = pline->s1 = maxshorten; @@ -474,11 +474,11 @@ void VectorDisplay::drawCircle(float _x, float _y, float _radius, float _steps) float edgeangle = 0.0f; float angadjust = 0.0f; - float step = bx::pi * 2.0f / _steps; + float step = bx::kPi * 2.0f / _steps; beginDraw(_x + _radius * bx::fsin(edgeangle + angadjust), _y - _radius * bx::fcos(edgeangle + angadjust) ); - for (edgeangle = 0; edgeangle < 2.0f * bx::pi - 0.001; edgeangle += step) + for (edgeangle = 0; edgeangle < 2.0f * bx::kPi - 0.001; edgeangle += step) { drawTo(_x + _radius * bx::fsin(edgeangle + step - angadjust), _y - _radius * bx::fcos(edgeangle + step - angadjust) ); @@ -495,28 +495,28 @@ void VectorDisplay::drawWheel(float _angle, float _x, float _y, float _radius) _y - spokeradius * bx::fcos(_angle), _x - spokeradius * bx::fsin(_angle), _y + spokeradius * bx::fcos(_angle) ); - drawLine(_x + spokeradius * bx::fsin(_angle + bx::pi / 4.0f), - _y - spokeradius * bx::fcos(_angle + bx::pi / 4.0f), - _x - spokeradius * bx::fsin(_angle + bx::pi / 4.0f), - _y + spokeradius * bx::fcos(_angle + bx::pi / 4.0f) ); - drawLine(_x + spokeradius * bx::fsin(_angle + bx::pi / 2.0f), - _y - spokeradius * bx::fcos(_angle + bx::pi / 2.0f), - _x - spokeradius * bx::fsin(_angle + bx::pi / 2.0f), - _y + spokeradius * bx::fcos(_angle + bx::pi / 2.0f) ); - drawLine(_x + spokeradius * bx::fsin(_angle + 3.0f * bx::pi / 4.0f), - _y - spokeradius * bx::fcos(_angle + 3.0f * bx::pi / 4.0f), - _x - spokeradius * bx::fsin(_angle + 3.0f * bx::pi / 4.0f), - _y + spokeradius * bx::fcos(_angle + 3.0f * bx::pi / 4.0f) ); + drawLine(_x + spokeradius * bx::fsin(_angle + bx::kPi / 4.0f), + _y - spokeradius * bx::fcos(_angle + bx::kPi / 4.0f), + _x - spokeradius * bx::fsin(_angle + bx::kPi / 4.0f), + _y + spokeradius * bx::fcos(_angle + bx::kPi / 4.0f) ); + drawLine(_x + spokeradius * bx::fsin(_angle + bx::kPi / 2.0f), + _y - spokeradius * bx::fcos(_angle + bx::kPi / 2.0f), + _x - spokeradius * bx::fsin(_angle + bx::kPi / 2.0f), + _y + spokeradius * bx::fcos(_angle + bx::kPi / 2.0f) ); + drawLine(_x + spokeradius * bx::fsin(_angle + 3.0f * bx::kPi / 4.0f), + _y - spokeradius * bx::fcos(_angle + 3.0f * bx::kPi / 4.0f), + _x - spokeradius * bx::fsin(_angle + 3.0f * bx::kPi / 4.0f), + _y + spokeradius * bx::fcos(_angle + 3.0f * bx::kPi / 4.0f) ); float edgeangle = 0.0f; float angadjust = 0.0f; beginDraw(_x + _radius * bx::fsin(_angle + edgeangle + angadjust), _y - _radius * bx::fcos(_angle + edgeangle + angadjust) ); - for (edgeangle = 0; edgeangle < 2.0f * bx::pi - 0.001f; edgeangle += bx::pi / 4.0f) + for (edgeangle = 0; edgeangle < 2.0f * bx::kPi - 0.001f; edgeangle += bx::kPi / 4.0f) { - drawTo(_x + _radius * bx::fsin(_angle + edgeangle + bx::pi / 4.0f - angadjust), - _y - _radius * bx::fcos(_angle + edgeangle + bx::pi / 4.0f - angadjust) ); + drawTo(_x + _radius * bx::fsin(_angle + edgeangle + bx::kPi / 4.0f - angadjust), + _y - _radius * bx::fcos(_angle + edgeangle + bx::kPi / 4.0f - angadjust) ); } endDraw(); @@ -603,7 +603,7 @@ void VectorDisplay::drawFan(float _cx, float _cy, float _pa, float _a, float _t, if (a2pa < pa2a) { _t = -_t; - nsteps = (int)bx::fmax(1, bx::fround(a2pa / (bx::pi / 8.0f) ) ); + nsteps = (int)bx::fmax(1, bx::fround(a2pa / (bx::kPi / 8.0f) ) ); angles = (float*)alloca(sizeof(float) * (nsteps + 1) ); for (i = 0; i <= nsteps; i++) { @@ -612,7 +612,7 @@ void VectorDisplay::drawFan(float _cx, float _cy, float _pa, float _a, float _t, } else { - nsteps = (int)bx::fmax(1, bx::fround(pa2a / (bx::pi / 8.0f) ) ); + nsteps = (int)bx::fmax(1, bx::fround(pa2a / (bx::kPi / 8.0f) ) ); angles = (float*)alloca(sizeof(float) * (nsteps + 1) ); for (i = 0; i <= nsteps; i++) { diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index cebf8186e..d217d00dd 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -125,7 +125,7 @@ class ExampleTerrain : public entry::AppI const float initialPos[3] = { s_terrainSize/2.0f, 100.0f, 0.0f }; cameraSetPosition(initialPos); - cameraSetVerticalAngle(-bx::pi/4.0f); + cameraSetVerticalAngle(-bx::kPi/4.0f); } virtual int shutdown() BX_OVERRIDE diff --git a/examples/28-wireframe/wireframe.cpp b/examples/28-wireframe/wireframe.cpp index 332a4f1e6..729258044 100644 --- a/examples/28-wireframe/wireframe.cpp +++ b/examples/28-wireframe/wireframe.cpp @@ -147,8 +147,8 @@ struct Camera static inline void vecFromLatLong(float _vec[3], float _u, float _v) { - const float phi = _u * 2.0f*bx::pi; - const float theta = _v * bx::pi; + const float phi = _u * 2.0f*bx::kPi; + const float theta = _v * bx::kPi; const float st = bx::fsin(theta); const float sp = bx::fsin(phi); @@ -165,8 +165,8 @@ struct Camera const float phi = bx::fatan2(_vec[0], _vec[2]); const float theta = bx::facos(_vec[1]); - _u = (bx::pi + phi)*bx::invPi*0.5f; - _v = theta*bx::invPi; + _u = (bx::kPi + phi)*bx::kInvPi*0.5f; + _v = theta*bx::kInvPi; } struct Interp3f @@ -337,7 +337,7 @@ class ExampleWireframe : public entry::AppI m_uniforms.init(); - m_meshes[0].init("meshes/bunny.bin", 1.0f, 0.0f, bx::pi, 0.0f, 0.0f, -0.8f, 0.0f); + m_meshes[0].init("meshes/bunny.bin", 1.0f, 0.0f, bx::kPi, 0.0f, 0.0f, -0.8f, 0.0f); m_meshes[1].init("meshes/hollowcube.bin", 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); m_meshes[2].init("meshes/orb.bin", 1.2f, 0.0f, 0.0f, 0.0f, 0.0f, -0.65f, 0.0f); diff --git a/examples/31-rsm/reflectiveshadowmap.cpp b/examples/31-rsm/reflectiveshadowmap.cpp index 73c7e0793..3f4d0fdac 100644 --- a/examples/31-rsm/reflectiveshadowmap.cpp +++ b/examples/31-rsm/reflectiveshadowmap.cpp @@ -672,8 +672,8 @@ public: void updateLightDir() { - float el = m_lightElevation * (bx::pi/180.0f); - float az = m_lightAzimuth * (bx::pi/180.0f); + float el = m_lightElevation * (bx::kPi/180.0f); + float az = m_lightAzimuth * (bx::kPi/180.0f); m_lightDir[0] = bx::fcos(el)*bx::fcos(az); m_lightDir[2] = bx::fcos(el)*bx::fsin(az); m_lightDir[1] = bx::fsin(el); diff --git a/examples/common/bounds.cpp b/examples/common/bounds.cpp index 0240da286..6a7e29577 100644 --- a/examples/common/bounds.cpp +++ b/examples/common/bounds.cpp @@ -216,7 +216,7 @@ void calcObb(Obb& _obb, const void* _vertices, uint32_t _numVertices, uint32_t _ Obb best; aabbToObb(best, aabb); - float angleStep = float(bx::piHalf/_steps); + float angleStep = float(bx::kPiHalf/_steps); float ax = 0.0f; float mtx[16]; diff --git a/examples/common/camera.cpp b/examples/common/camera.cpp index 2b8f7050f..52a6d1433 100644 --- a/examples/common/camera.cpp +++ b/examples/common/camera.cpp @@ -173,9 +173,9 @@ struct Camera float right[3] = { - bx::fsin(m_horizontalAngle - bx::piHalf), + bx::fsin(m_horizontalAngle - bx::kPiHalf), 0, - bx::fcos(m_horizontalAngle - bx::piHalf), + bx::fcos(m_horizontalAngle - bx::kPiHalf), }; float up[3]; diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index 152334903..b6139a54e 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -495,7 +495,7 @@ struct DebugDraw Mesh::Enum id = Mesh::Enum(Mesh::Cone0+mesh); const uint32_t num = getCircleLod(uint8_t(mesh) ); - const float step = bx::pi * 2.0f / num; + const float step = bx::kPi * 2.0f / num; const uint32_t numVertices = num+1; const uint32_t numIndices = num*6; @@ -556,7 +556,7 @@ struct DebugDraw Mesh::Enum id = Mesh::Enum(Mesh::Cylinder0+mesh); const uint32_t num = getCircleLod(uint8_t(mesh) ); - const float step = bx::pi * 2.0f / num; + const float step = bx::kPi * 2.0f / num; const uint32_t numVertices = num*2; const uint32_t numIndices = num*12; @@ -626,7 +626,7 @@ struct DebugDraw Mesh::Enum id = Mesh::Enum(Mesh::Capsule0+mesh); const uint32_t num = getCircleLod(uint8_t(mesh) ); - const float step = bx::pi * 2.0f / num; + const float step = bx::kPi * 2.0f / num; const uint32_t numVertices = num*2; const uint32_t numIndices = num*6; @@ -1202,7 +1202,7 @@ struct DebugDraw { const Attrib& attrib = m_attrib[m_stack]; const uint32_t num = getCircleLod(attrib.m_lod); - const float step = bx::pi * 2.0f / num; + const float step = bx::kPi * 2.0f / num; _degrees = bx::fwrap(_degrees, 360.0f); @@ -1244,7 +1244,7 @@ struct DebugDraw { const Attrib& attrib = m_attrib[m_stack]; const uint32_t num = getCircleLod(attrib.m_lod); - const float step = bx::pi * 2.0f / num; + const float step = bx::kPi * 2.0f / num; _weight = bx::fclamp(_weight, 0.0f, 2.0f); float udir[3]; @@ -1291,7 +1291,7 @@ struct DebugDraw { const Attrib& attrib = m_attrib[m_stack]; const uint32_t num = getCircleLod(attrib.m_lod); - const float step = bx::pi * 2.0f / num; + const float step = bx::kPi * 2.0f / num; _weight = bx::fclamp(_weight, 0.0f, 2.0f); float xy0[2]; diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 6b1915d55..f89e0446e 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -510,7 +510,7 @@ struct Imgui for (int32_t ii = 0; ii < NUM_CIRCLE_VERTS; ++ii) { - float a = (float)ii / (float)NUM_CIRCLE_VERTS * (float)(bx::pi * 2.0); + float a = (float)ii / (float)NUM_CIRCLE_VERTS * (float)(bx::kPi * 2.0); m_circleVerts[ii * 2 + 0] = cosf(a); m_circleVerts[ii * 2 + 1] = sinf(a); } diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index beb47cff1..e09fb3243 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -375,8 +375,8 @@ namespace ps Aabb aabb = { - { bx::huge, bx::huge, bx::huge }, - { -bx::huge, -bx::huge, -bx::huge }, + { bx::kHuge, bx::kHuge, bx::kHuge }, + { -bx::kHuge, -bx::kHuge, -bx::kHuge }, }; for (uint32_t jj = 0, num = m_num, current = _first diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 8e55bcc33..54b738ac5 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -305,7 +305,7 @@ struct View m_angle = bx::toRad(angle); } - m_angle = bx::fwrap(m_angle, bx::pi*2.0f); + m_angle = bx::fwrap(m_angle, bx::kPi*2.0f); } else {