From f179aea4d758e1e6eea3b8e39a47fa90b2db71c7 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 13 May 2025 09:22:23 +0300 Subject: [PATCH] removed even float type from vector classes --- include/omath/vector2.hpp | 4 ++-- include/omath/vector3.hpp | 6 +++--- include/omath/vector4.hpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/omath/vector2.hpp b/include/omath/vector2.hpp index 03a98cc..0f31bc3 100644 --- a/include/omath/vector2.hpp +++ b/include/omath/vector2.hpp @@ -174,12 +174,12 @@ namespace omath return {x - v.x, y - v.y}; } - [[nodiscard]] constexpr Vector2 operator*(const float fl) const noexcept + [[nodiscard]] constexpr Vector2 operator*(const Type& fl) const noexcept { return {x * fl, y * fl}; } - [[nodiscard]] constexpr Vector2 operator/(const float fl) const noexcept + [[nodiscard]] constexpr Vector2 operator/(const Type& fl) const noexcept { return {x / fl, y / fl}; } diff --git a/include/omath/vector3.hpp b/include/omath/vector3.hpp index fc30297..1f0316b 100644 --- a/include/omath/vector3.hpp +++ b/include/omath/vector3.hpp @@ -185,7 +185,7 @@ namespace omath return {this->x - v.x, this->y - v.y, z - v.z}; } - [[nodiscard]] constexpr Vector3 operator*(const float fl) const noexcept + [[nodiscard]] constexpr Vector3 operator*(const Type& fl) const noexcept { return {this->x * fl, this->y * fl, z * fl}; } @@ -195,7 +195,7 @@ namespace omath return {this->x * v.x, this->y * v.y, z * v.z}; } - [[nodiscard]] constexpr Vector3 operator/(const float fl) const noexcept + [[nodiscard]] constexpr Vector3 operator/(const Type& fl) const noexcept { return {this->x / fl, this->y / fl, z / fl}; } @@ -245,7 +245,7 @@ namespace omath [[nodiscard]] Vector3 view_angle_to(const Vector3& other) const noexcept { - const float distance = distance_to(other); + const auto distance = distance_to(other); const auto delta = other - *this; return {angles::radians_to_degrees(std::asin(delta.z / distance)), diff --git a/include/omath/vector4.hpp b/include/omath/vector4.hpp index 2f69989..dfc403f 100644 --- a/include/omath/vector4.hpp +++ b/include/omath/vector4.hpp @@ -47,7 +47,7 @@ namespace omath return *this; } - constexpr Vector4& operator*=(const float scalar) noexcept + constexpr Vector4& operator*=(const Type& scalar) noexcept { Vector3::operator*=(scalar); w *= scalar; @@ -63,7 +63,7 @@ namespace omath return *this; } - constexpr Vector4& operator/=(const float scalar) noexcept + constexpr Vector4& operator/=(const Type& scalar) noexcept { Vector3::operator/=(scalar); w /= scalar;