From 95eed94c9294f719724283e672cc7c83b2abd282 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Jan 2024 01:10:26 +0000 Subject: Unified crossProduct --- gfx/gl/camera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gfx') diff --git a/gfx/gl/camera.cpp b/gfx/gl/camera.cpp index d362b94..0bc911a 100644 --- a/gfx/gl/camera.cpp +++ b/gfx/gl/camera.cpp @@ -31,8 +31,8 @@ Camera::updateView() Direction3D Camera::upFromForward(const Direction3D & forward) { - const auto right = glm::cross(forward, ::down); - return glm::cross(forward, right); + const auto right = crossProduct(forward, ::down); + return crossProduct(forward, right); } std::array -- cgit v1.2.3 From 6a1df3dfbae98a05e74c646cc216fbc19ffdb6d6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 7 Jan 2024 13:04:31 +0000 Subject: Template Ray on position type --- gfx/gl/camera.cpp | 2 +- gfx/gl/camera.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gfx') diff --git a/gfx/gl/camera.cpp b/gfx/gl/camera.cpp index 0bc911a..fb711dd 100644 --- a/gfx/gl/camera.cpp +++ b/gfx/gl/camera.cpp @@ -13,7 +13,7 @@ Camera::Camera(GlobalPosition3D pos, Angle fov, Angle aspect, GlobalDistance zNe updateView(); } -Ray +Ray Camera::unProject(const ScreenRelCoord & mouse) const { static constexpr const glm::vec4 screen {0, 0, 1, 1}; diff --git a/gfx/gl/camera.h b/gfx/gl/camera.h index eca7b8f..8d53261 100644 --- a/gfx/gl/camera.h +++ b/gfx/gl/camera.h @@ -15,7 +15,7 @@ public: return viewProjection; } - [[nodiscard]] Ray unProject(const ScreenRelCoord &) const; + [[nodiscard]] Ray unProject(const ScreenRelCoord &) const; void setPosition(const GlobalPosition3D & p) -- cgit v1.2.3