diff options
Diffstat (limited to '3rdparty/bgfx/examples/30-picking')
5 files changed, 15 insertions, 15 deletions
diff --git a/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc b/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc index 603eab3019d..5e64d998c28 100644 --- a/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc +++ b/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2018 Branimir Karadzic. All rights reserved. + * Copyright 2011-2019 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ diff --git a/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc b/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc index 7939b6ab9a1..0e073c643f0 100644 --- a/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc +++ b/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc @@ -1,7 +1,7 @@ $input v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2018 Branimir Karadzic. All rights reserved. + * Copyright 2011-2019 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ diff --git a/3rdparty/bgfx/examples/30-picking/makefile b/3rdparty/bgfx/examples/30-picking/makefile index 171709170a4..ef9203197d7 100644 --- a/3rdparty/bgfx/examples/30-picking/makefile +++ b/3rdparty/bgfx/examples/30-picking/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2018 Branimir Karadzic. All rights reserved. +# Copyright 2011-2019 Branimir Karadzic. All rights reserved. # License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause # diff --git a/3rdparty/bgfx/examples/30-picking/picking.cpp b/3rdparty/bgfx/examples/30-picking/picking.cpp index 7847e1ba406..0b9d7484670 100644 --- a/3rdparty/bgfx/examples/30-picking/picking.cpp +++ b/3rdparty/bgfx/examples/30-picking/picking.cpp @@ -21,8 +21,8 @@ namespace class ExamplePicking : public entry::AppI { public: - ExamplePicking(const char* _name, const char* _description) - : entry::AppI(_name, _description) + ExamplePicking(const char* _name, const char* _description, const char* _url) + : entry::AppI(_name, _description, _url) { } @@ -268,17 +268,12 @@ public: float mouseXNDC = ( m_mouseState.m_mx / (float)m_width ) * 2.0f - 1.0f; float mouseYNDC = ((m_height - m_mouseState.m_my) / (float)m_height) * 2.0f - 1.0f; - float pickEye[3]; - float mousePosNDC[3] = { mouseXNDC, mouseYNDC, 0.0f }; - bx::vec3MulMtxH(pickEye, mousePosNDC, invViewProj); - - float pickAt[3]; - float mousePosNDCEnd[3] = { mouseXNDC, mouseYNDC, 1.0f }; - bx::vec3MulMtxH(pickAt, mousePosNDCEnd, invViewProj); + const bx::Vec3 pickEye = bx::mulH({ mouseXNDC, mouseYNDC, 0.0f }, invViewProj); + const bx::Vec3 pickAt = bx::mulH({ mouseXNDC, mouseYNDC, 1.0f }, invViewProj); // Look at our unprojected point float pickView[16]; - bx::mtxLookAt(pickView, bx::load(pickEye), bx::load(pickAt) ); + bx::mtxLookAt(pickView, pickEye, pickAt); // Tight FOV is best for picking float pickProj[16]; @@ -447,4 +442,9 @@ public: } // namespace -ENTRY_IMPLEMENT_MAIN(ExamplePicking, "30-picking", "Mouse picking via GPU texture readback."); +ENTRY_IMPLEMENT_MAIN( + ExamplePicking + , "30-picking" + , "Mouse picking via GPU texture readback." + , "https://bkaradzic.github.io/bgfx/examples.html#picking" + ); diff --git a/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc b/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc index fb54484949d..be741da225c 100644 --- a/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc +++ b/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc @@ -2,7 +2,7 @@ $input a_position, a_normal $output v_pos, v_view, v_normal, v_color0 /* - * Copyright 2011-2018 Branimir Karadzic. All rights reserved. + * Copyright 2011-2019 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause */ |