From 01921cc3bc5d5f80deebfb4c3d7160790c5cda67 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Mon, 23 Sep 2024 14:04:57 +0200 Subject: [PATCH] bugfixes --- openVulkanoCpp/Math/DenseVector3i.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openVulkanoCpp/Math/DenseVector3i.hpp b/openVulkanoCpp/Math/DenseVector3i.hpp index 35d06bd..3673596 100644 --- a/openVulkanoCpp/Math/DenseVector3i.hpp +++ b/openVulkanoCpp/Math/DenseVector3i.hpp @@ -78,7 +78,7 @@ namespace OpenVulkano::Math public: constexpr explicit DenseVector3i(const Math::Vector3i& vec3) : DenseVector3i(vec3.x, vec3.y, vec3.z) {} constexpr explicit DenseVector3i(const Math::Vector3i_SIMD& vec3) : DenseVector3i(vec3.x, vec3.y, vec3.z) {} - constexpr DenseVector3i(int x, int y, int z) + constexpr DenseVector3i(T x, T y, T z) : data((x & BITMASK) | ((y & BITMASK) << (2 * BITS)) | ((z & BITMASK) << BITS)) { AssertValue(x); @@ -88,9 +88,9 @@ namespace OpenVulkano::Math constexpr T Data() const { return data; } - [[nodiscard]] constexpr int X() const { int v = data & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return reinterpret_cast(v); } - [[nodiscard]] constexpr int Y() const { int v = (data >> (2 * BITS)) & BITMASK; if (v > MAX_VALUE_Y) v |= ~BITMASK; return reinterpret_cast(v); } - [[nodiscard]] constexpr int Z() const { int v = (data >> BITS) & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return reinterpret_cast(v); } + [[nodiscard]] constexpr int X() const { T v = data & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return reinterpret_cast(v); } + [[nodiscard]] constexpr int Y() const { T v = (data >> (2 * BITS)) & BITMASK; if (v > MAX_VALUE_Y) v |= ~BITMASK; return reinterpret_cast(v); } + [[nodiscard]] constexpr int Z() const { T v = (data >> BITS) & BITMASK; if (v > MAX_VALUE) v |= ~BITMASK; return reinterpret_cast(v); } void SetX(int x) { @@ -120,7 +120,7 @@ namespace OpenVulkano::Math return fmt::format("{},{},{}", X(), Y(), Z()); } - [[nodiscard]] constexpr operator T() const { return data; } + //[[nodiscard]] constexpr operator T() const { return data; } [[nodiscard]] constexpr bool operator <(DenseVec3 rhs) const {