diff options
author | 2021-10-02 18:21:12 +0200 | |
---|---|---|
committer | 2021-10-02 12:21:12 -0400 | |
commit | 0eeb918991d9d9d5acac6eab82fb6b73b9ff71b4 (patch) | |
tree | b6cf6f1b41da8b7650252e8275e69573811692aa /3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp | |
parent | 1d61695dabe1aebe22a5db080ec7cc3dac680906 (diff) |
Update bgfx, bx and bimg to latest upstream (fixes issue #8057) (#8645)
Diffstat (limited to '3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp index ec0c73474e1..782e3ddeba5 100644 --- a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp +++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp @@ -295,30 +295,14 @@ uint32_t genSphere(uint8_t _subdiv0, void* _pos0 = NULL, uint16_t _posStride0 = bx::Vec3 getPoint(Axis::Enum _axis, float _x, float _y) { - bx::Vec3 result; - switch (_axis) { - case Axis::X: - result.x = 0.0f; - result.y = _x; - result.z = _y; - break; - - case Axis::Y: - result.x = _y; - result.y = 0.0f; - result.z = _x; - break; - - default: - result.x = _x; - result.y = _y; - result.z = 0.0f; - break; + case Axis::X: return { 0.0f, _x, _y }; + case Axis::Y: return { _y, 0.0f, _x }; + default: break; } - return result; + return { _x, _y, 0.0f }; } #include "vs_debugdraw_lines.bin.h" @@ -1664,7 +1648,7 @@ struct DebugDrawEncoderImpl void drawFrustum(const float* _viewProj) { - bx::Plane planes[6]; + bx::Plane planes[6] = { bx::init::None, bx::init::None, bx::init::None, bx::init::None, bx::init::None, bx::init::None }; buildFrustumPlanes(planes, _viewProj); const bx::Vec3 points[8] = @@ -1761,8 +1745,8 @@ struct DebugDrawEncoderImpl const float step = bx::kPi * 2.0f / num; _weight = bx::clamp(_weight, 0.0f, 2.0f); - bx::Vec3 udir; - bx::Vec3 vdir; + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); float xy0[2]; @@ -1833,7 +1817,8 @@ struct DebugDrawEncoderImpl const Attrib& attrib = m_attrib[m_stack]; if (attrib.m_wireframe) { - bx::Vec3 udir, vdir; + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); const float halfExtent = _size*0.5f; @@ -1874,7 +1859,8 @@ struct DebugDrawEncoderImpl const Attrib& attrib = m_attrib[m_stack]; - bx::Vec3 udir, vdir; + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); const Pack2D& pack = s_dds.m_sprite.get(_handle); @@ -1994,8 +1980,8 @@ struct DebugDrawEncoderImpl if (_thickness > 0.0f) { const bx::Vec3 from = { _x, _y, _z }; - bx::Vec3 mid; - bx::Vec3 to; + bx::Vec3 mid(bx::init::None); + bx::Vec3 to(bx::init::None); setColor(Axis::X == _highlight ? 0xff00ffff : 0xff0000ff); mid = { _x + _len - _thickness, _y, _z }; @@ -2037,8 +2023,8 @@ struct DebugDrawEncoderImpl { const Attrib& attrib = m_attrib[m_stack]; - bx::Vec3 udir; - bx::Vec3 vdir; + bx::Vec3 udir(bx::init::None); + bx::Vec3 vdir(bx::init::None); bx::calcTangentFrame(udir, vdir, _normal, attrib.m_spin); udir = bx::mul(udir, _step); |