From ece25a36b413a812be6033f293a9af399ff3a4a6 Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Sun, 27 Mar 2016 04:55:29 +0200 Subject: [PATCH 1/3] Added missing overloads. --- include/bx/fpumath.h | 84 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 17 deletions(-) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index ad9084d..6d404e5 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -766,21 +766,6 @@ namespace bx mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); } - inline void mtxProjInf(float* _result, const float _fov[4], float _near, bool _oglNdc = false) - { - mtxProjInf_impl(_result, _fov, _near, _oglNdc); - } - - inline void mtxProjInfLh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) - { - mtxProjInf_impl(_result, _fov, _near, _oglNdc); - } - - inline void mtxProjInfRh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) - { - mtxProjInf_impl(_result, _fov, _near, _oglNdc); - } - template inline void mtxProjInf_impl(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) { @@ -789,14 +774,79 @@ namespace bx mtxProjInfXYWH(_result, 0.0f, 0.0f, width, height, _near, _oglNdc); } + inline void mtxProjInf(float* _result, const float _fov[4], float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + } + + inline void mtxProjInf(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _ut, _dt, _lt, _rt, _near, _oglNdc); + } + + inline void mtxProjInf(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); + } + + inline void mtxProjInfLh(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _ut, _dt, _lt, _rt, _near, _oglNdc); + } + + inline void mtxProjInfLh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + } + + inline void mtxProjInfLh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); + } + + inline void mtxProjInfRh(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _ut, _dt, _lt, _rt, _near, _oglNdc); + } + + inline void mtxProjInfRh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + } + + inline void mtxProjInfRh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); + } + + inline void mtxProjRevInfLh(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _ut, _dt, _lt, _rt, _near, _oglNdc); + } + + inline void mtxProjRevInfLh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + } + inline void mtxProjRevInfLh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); + mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); + } + + inline void mtxProjRevInfRh(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _ut, _dt, _lt, _rt, _near, _oglNdc); + } + + inline void mtxProjRevInfRh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) + { + mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); } inline void mtxProjRevInfRh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); + mtxProjInf_impl(_result, _fovy, _aspect, _near, _oglNdc); } template From 590d35a7e7cec758406cfdcedd708aed801ba67f Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Sun, 27 Mar 2016 05:00:19 +0200 Subject: [PATCH 2/3] Amend for previous commit. --- include/bx/fpumath.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index 6d404e5..4cf3158 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -776,7 +776,7 @@ namespace bx inline void mtxProjInf(float* _result, const float _fov[4], float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + mtxProjInf_impl(_result, _fov, _near, _oglNdc); } inline void mtxProjInf(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc = false) @@ -796,7 +796,7 @@ namespace bx inline void mtxProjInfLh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + mtxProjInf_impl(_result, _fov, _near, _oglNdc); } inline void mtxProjInfLh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) @@ -811,7 +811,7 @@ namespace bx inline void mtxProjInfRh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + mtxProjInf_impl(_result, _fov, _near, _oglNdc); } inline void mtxProjInfRh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) @@ -826,7 +826,7 @@ namespace bx inline void mtxProjRevInfLh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + mtxProjInf_impl(_result, _fov, _near, _oglNdc); } inline void mtxProjRevInfLh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false) @@ -871,17 +871,17 @@ namespace bx inline void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset = 0.0f, bool _oglNdc = false) { - mtxOrtho_impl(_result, _left, _right, _bottom, _top, _near, _far, _offset, _oglNdc); + mtxOrtho_impl(_result, _left, _right, _bottom, _top, _near, _far, _offset, _oglNdc); } inline void mtxOrthoLh(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset = 0.0f, bool _oglNdc = false) { - mtxOrtho_impl(_result, _left, _right, _bottom, _top, _near, _far, _offset, _oglNdc); + mtxOrtho_impl(_result, _left, _right, _bottom, _top, _near, _far, _offset, _oglNdc); } inline void mtxOrthoRh(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset = 0.0f, bool _oglNdc = false) { - mtxOrtho_impl(_result, _left, _right, _bottom, _top, _near, _far, _offset, _oglNdc); + mtxOrtho_impl(_result, _left, _right, _bottom, _top, _near, _far, _offset, _oglNdc); } inline void mtxRotateX(float* _result, float _ax) From 92554d72bef25c862bbf9f5d23e540503e5a59fa Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Sun, 27 Mar 2016 05:07:23 +0200 Subject: [PATCH 3/3] Added more missing overloads. --- include/bx/fpumath.h | 47 +++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index 4cf3158..e1d82a9 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -684,21 +684,6 @@ namespace bx mtxProj_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _far, _oglNdc); } - inline void mtxProj(float* _result, const float _fov[4], float _near, float _far, bool _oglNdc = false) - { - mtxProj_impl(_result, _fov, _near, _far, _oglNdc); - } - - inline void mtxProjLh(float* _result, const float _fov[4], float _near, float _far, bool _oglNdc = false) - { - mtxProj_impl(_result, _fov, _near, _far, _oglNdc); - } - - inline void mtxProjRh(float* _result, const float _fov[4], float _near, float _far, bool _oglNdc = false) - { - mtxProj_impl(_result, _fov, _near, _far, _oglNdc); - } - template inline void mtxProj_impl(float* _result, float _fovy, float _aspect, float _near, float _far, bool _oglNdc = false) { @@ -707,16 +692,46 @@ namespace bx mtxProjXYWH(_result, 0.0f, 0.0f, width, height, _near, _far, _oglNdc); } + inline void mtxProj(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, float _far, bool _oglNdc = false) + { + mtxProj_impl(_result, _ut, _dt, _lt, _rt, _near, _far, _oglNdc); + } + + inline void mtxProj(float* _result, const float _fov[4], float _near, float _far, bool _oglNdc = false) + { + mtxProj_impl(_result, _fov, _near, _far, _oglNdc); + } + inline void mtxProj(float* _result, float _fovy, float _aspect, float _near, float _far, bool _oglNdc = false) { mtxProj_impl(_result, _fovy, _aspect, _near, _far, _oglNdc); } + inline void mtxProjLh(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, float _far, bool _oglNdc = false) + { + mtxProj_impl(_result, _ut, _dt, _lt, _rt, _near, _far, _oglNdc); + } + + inline void mtxProjLh(float* _result, const float _fov[4], float _near, float _far, bool _oglNdc = false) + { + mtxProj_impl(_result, _fov, _near, _far, _oglNdc); + } + inline void mtxProjLh(float* _result, float _fovy, float _aspect, float _near, float _far, bool _oglNdc = false) { mtxProj_impl(_result, _fovy, _aspect, _near, _far, _oglNdc); } + inline void mtxProjRh(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, float _far, bool _oglNdc = false) + { + mtxProj_impl(_result, _ut, _dt, _lt, _rt, _near, _far, _oglNdc); + } + + inline void mtxProjRh(float* _result, const float _fov[4], float _near, float _far, bool _oglNdc = false) + { + mtxProj_impl(_result, _fov, _near, _far, _oglNdc); + } + inline void mtxProjRh(float* _result, float _fovy, float _aspect, float _near, float _far, bool _oglNdc = false) { mtxProj_impl(_result, _fovy, _aspect, _near, _far, _oglNdc); @@ -841,7 +856,7 @@ namespace bx inline void mtxProjRevInfRh(float* _result, const float _fov[4], float _near, bool _oglNdc = false) { - mtxProjInf_impl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc); + mtxProjInf_impl(_result, _fov, _near, _oglNdc); } inline void mtxProjRevInfRh(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc = false)