diff options
author | 2016-06-08 19:50:19 +0200 | |
---|---|---|
committer | 2016-06-08 20:42:23 +0200 | |
commit | a3af73bafcac0f94de44430b6e2b521aac5481a9 (patch) | |
tree | 0f46ad9c3575bdfd58dfa6140c24d01da30b787c /3rdparty/bgfx/examples/common/bounds.cpp | |
parent | e8cb3e06d030cd4a04df0db786081af6436288c2 (diff) |
BGFX and BX update (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/bounds.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/bounds.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/3rdparty/bgfx/examples/common/bounds.cpp b/3rdparty/bgfx/examples/common/bounds.cpp index f8f7113e08b..ff34238c3f3 100644 --- a/3rdparty/bgfx/examples/common/bounds.cpp +++ b/3rdparty/bgfx/examples/common/bounds.cpp @@ -279,26 +279,7 @@ void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _num void calcPlaneUv(const Plane& _plane, float* _udir, float* _vdir) { - const float nx = _plane.m_normal[0]; - const float ny = _plane.m_normal[1]; - const float nz = _plane.m_normal[2]; - - if (bx::fabsolute(nx) > bx::fabsolute(nz) ) - { - float invLen = 1.0f / bx::fsqrt(nx*nx + nz*nz); - _udir[0] = -nz * invLen; - _udir[1] = 0.0f; - _udir[2] = nx * invLen; - } - else - { - float invLen = 1.0f / bx::fsqrt(ny*ny + nz*nz); - _udir[0] = 0.0f; - _udir[1] = nz * invLen; - _udir[2] = -ny * invLen; - } - - bx::vec3Cross(_vdir, _plane.m_normal, _udir); + bx::vec3TangentFrame(_plane.m_normal, _udir, _vdir); } void buildFrustumPlanes(Plane* _result, const float* _viewProj) |