diff --git a/CMakeLists.txt b/CMakeLists.txt index 93185fd..77c6563 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.16.19) +set(BLT_VERSION 0.16.20) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/math/vectors.h b/include/blt/math/vectors.h index 061362c..89fe7fc 100644 --- a/include/blt/math/vectors.h +++ b/include/blt/math/vectors.h @@ -291,39 +291,39 @@ namespace blt return initializer; } - template - inline constexpr vec operator+(const vec& left, T right) + template + inline constexpr vec operator+(const vec& left, G right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = left[i] + right; + initializer[i] = left[i] + static_cast(right); return initializer; } - template - inline constexpr vec operator-(const vec& left, T right) + template + inline constexpr vec operator-(const vec& left, G right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = left[i] + right; + initializer[i] = left[i] + static_cast(right); return initializer; } - template - inline constexpr vec operator+(T f, const vec& right) + template + inline constexpr vec operator+(G left, const vec& right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = f + right[i]; + initializer[i] = static_cast(left) + right[i]; return initializer; } - template - inline constexpr vec operator-(T f, const vec& right) + template + inline constexpr vec operator-(G left, const vec& right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = f - right[i]; + initializer[i] = static_cast(left) - right[i]; return initializer; } @@ -336,39 +336,39 @@ namespace blt return initializer; } - template - inline constexpr vec operator*(const vec& left, T right) + template + inline constexpr vec operator*(const vec& left, G right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = left[i] * right; + initializer[i] = left[i] * static_cast(right); return initializer; } - template - inline constexpr vec operator*(T f, const vec& right) + template + inline constexpr vec operator*(G left, const vec& right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = f * right[i]; + initializer[i] = static_cast(left) * right[i]; return initializer; } - template - inline constexpr vec operator/(const vec& left, T right) + template + inline constexpr vec operator/(const vec& left, G right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = left[i] / right; + initializer[i] = left[i] / static_cast(right); return initializer; } - template - inline constexpr vec operator/(T left, const vec& right) + template + inline constexpr vec operator/(G left, const vec& right) { vec initializer{}; for (blt::u32 i = 0; i < size; i++) - initializer[i] = left / right[i]; + initializer[i] = static_cast(left) / right[i]; return initializer; }