diff options
author | 2017-03-29 17:09:40 +0200 | |
---|---|---|
committer | 2017-03-29 17:09:40 +0200 | |
commit | 49f7c99c7786ce257fae28dfeae2f8ee5810424c (patch) | |
tree | 1bbd30dd4dd48596186846c2fc77a8dc748215d2 /3rdparty/bgfx/examples/02-metaballs/metaballs.cpp | |
parent | 79f22e060b2c012d628d5d1d83288c1bb6e6acef (diff) |
Update BGFX and BX (nw)
Diffstat (limited to '3rdparty/bgfx/examples/02-metaballs/metaballs.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/02-metaballs/metaballs.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp index cd6865da730..60728cc672a 100644 --- a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp +++ b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp @@ -371,7 +371,7 @@ float vertLerp(float* __restrict _result, float _iso, uint32_t _idx0, float _v0, const float* __restrict edge0 = s_cube[_idx0]; const float* __restrict edge1 = s_cube[_idx1]; - if (fabsf(_iso-_v1) < 0.00001f) + if (bx::fabsolute(_iso-_v1) < 0.00001f) { _result[0] = edge1[0]; _result[1] = edge1[1]; @@ -379,8 +379,8 @@ float vertLerp(float* __restrict _result, float _iso, uint32_t _idx0, float _v0, return 1.0f; } - if (fabsf(_iso-_v0) < 0.00001f - || fabsf(_v0-_v1) < 0.00001f) + if (bx::fabsolute(_iso-_v0) < 0.00001f + || bx::fabsolute(_v0-_v1) < 0.00001f) { _result[0] = edge0[0]; _result[1] = edge0[1]; @@ -576,7 +576,7 @@ class ExampleMetaballs : public entry::AppI bx::mtxLookAt(view, eye, at); float proj[16]; - bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f); + bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(0, view, proj); // Set view 0 default viewport. @@ -598,10 +598,10 @@ class ExampleMetaballs : public entry::AppI float sphere[numSpheres][4]; for (uint32_t ii = 0; ii < numSpheres; ++ii) { - sphere[ii][0] = sinf(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f); - sphere[ii][1] = sinf(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f); - sphere[ii][2] = cosf(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f); - sphere[ii][3] = 1.0f/(2.0f + (sinf(time*(ii*0.13f) )*0.5f+0.5f)*2.0f); + sphere[ii][0] = bx::fsin(time*(ii*0.21f)+ii*0.37f) * (DIMS * 0.5f - 8.0f); + sphere[ii][1] = bx::fsin(time*(ii*0.37f)+ii*0.67f) * (DIMS * 0.5f - 8.0f); + sphere[ii][2] = bx::fcos(time*(ii*0.11f)+ii*0.13f) * (DIMS * 0.5f - 8.0f); + sphere[ii][3] = 1.0f/(2.0f + (bx::fsin(time*(ii*0.13f) )*0.5f+0.5f)*2.0f); } profUpdate = bx::getHPCounter(); |