From c0f0bb3c2e600b4c5f588f8743bd6a0743005064 Mon Sep 17 00:00:00 2001 From: Orange Date: Wed, 27 Aug 2025 20:07:47 +0300 Subject: [PATCH 1/3] com --- extlibs/glm | 1 + 1 file changed, 1 insertion(+) create mode 160000 extlibs/glm diff --git a/extlibs/glm b/extlibs/glm new file mode 160000 index 0000000..2d4c4b4 --- /dev/null +++ b/extlibs/glm @@ -0,0 +1 @@ +Subproject commit 2d4c4b4dd31fde06cfffad7915c2b3006402322f From 9a7a4c7ffff1fe9b929bf54a298a081417094f75 Mon Sep 17 00:00:00 2001 From: Orange Date: Wed, 27 Aug 2025 20:22:33 +0300 Subject: [PATCH 2/3] Removed submodule extlibs/glm --- extlibs/glm | 1 - 1 file changed, 1 deletion(-) delete mode 160000 extlibs/glm diff --git a/extlibs/glm b/extlibs/glm deleted file mode 160000 index 2d4c4b4..0000000 --- a/extlibs/glm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d4c4b4dd31fde06cfffad7915c2b3006402322f From 75565ecf2d0d5cf3c257b8376c45ef3e5675000f Mon Sep 17 00:00:00 2001 From: Orange Date: Wed, 27 Aug 2025 23:17:56 +0300 Subject: [PATCH 3/3] Adds left- and right-handed ortho matrices. Adds functions to generate left- and right-handed orthographic projection matrices. This provides more flexibility when defining a projection for rendering. --- include/omath/mat.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/omath/mat.hpp b/include/omath/mat.hpp index 0ad81f1..1f1f086 100644 --- a/include/omath/mat.hpp +++ b/include/omath/mat.hpp @@ -479,6 +479,35 @@ namespace omath {0.f, 0.f, -(far + near) / (far - near), -(2.f * near * far) / (far - near)}, {0.f, 0.f, -1.f, 0.f}}; } + template + [[nodiscard]] + Mat<4, 4, Type, St> mat_ortho_left_handed(const Type left, const Type right, + const Type bottom, const Type top, + const Type near, const Type far) noexcept + { + return + { + { static_cast(2) / (right - left), 0.f, 0.f, -(right + left) / (right - left)}, + { 0.f, static_cast(2) / (top - bottom), 0.f, -(top + bottom) / (top - bottom)}, + { 0.f, 0.f, static_cast(2) / (far - near), -(far + near) / (far - near) }, + { 0.f, 0.f, 0.f, 1.f } + }; + } + template + [[nodiscard]] + Mat<4, 4, Type, St> mat_ortho_right_handed(const Type left, const Type right, + const Type bottom, const Type top, + const Type near, const Type far) noexcept + { + return + { + { static_cast(2) / (right - left), 0.f, 0.f, -(right + left) / (right - left)}, + { 0.f, static_cast(2) / (top - bottom), 0.f, -(top + bottom) / (top - bottom)}, + { 0.f, 0.f, -static_cast(2) / (far - near), -(far + near) / (far - near) }, + { 0.f, 0.f, 0.f, 1.f } + }; + } + } // namespace omath template