diff --git a/Engine/Source/Runtime/Core/public/Math/Vector2.hpp b/Engine/Source/Runtime/Core/public/Math/Vector2.hpp index 0aa92c7..8cfd950 100644 --- a/Engine/Source/Runtime/Core/public/Math/Vector2.hpp +++ b/Engine/Source/Runtime/Core/public/Math/Vector2.hpp @@ -684,7 +684,7 @@ namespace Phanes::Core::Math { template TVector2 ReflectV(TVector2& v1, const TVector2& normal) { - Set(v1, v1 - (2 * (v1 * normal) * normal)); + Set(v1, v1 - (2 * DotP(v1, normal) * normal)); return v1; } @@ -855,7 +855,7 @@ namespace Phanes::Core::Math { // ============================================================== // - // TVector2 static function implementation with return values // + // TVector2 static function implementation with return values // // ============================================================== // @@ -871,7 +871,7 @@ namespace Phanes::Core::Math { template TVector2 Reflect(const TVector2& v1, const TVector2& normal) { - return TVector2(v1 - (2 * (v1 * normal) * normal)); + return TVector2(v1 - (2 * DotP(v1, normal) * normal)); } /** diff --git a/Engine/Source/Runtime/Core/public/Math/Vector3.hpp b/Engine/Source/Runtime/Core/public/Math/Vector3.hpp index 30ed8b4..e3cf5c2 100644 --- a/Engine/Source/Runtime/Core/public/Math/Vector3.hpp +++ b/Engine/Source/Runtime/Core/public/Math/Vector3.hpp @@ -375,7 +375,7 @@ namespace Phanes::Core::Math { template TVector3 ReflectV(TVector3& v1, const TVector3& normal) { - Set(v1, v1 - (2 * (v1 * normal) * normal)); + Set(v1, v1 - (2 * DotP(v1, normal) * normal)); return v1; } @@ -962,7 +962,7 @@ namespace Phanes::Core::Math { template TVector3 Reflect(const TVector3& v1, const TVector3& normal) { - return v1 - (2 * (v1 * normal) * normal); + return v1 - (2 * DotP(v1, normal) * normal); } diff --git a/Engine/Source/Runtime/Core/public/Math/Vector4.hpp b/Engine/Source/Runtime/Core/public/Math/Vector4.hpp index c1f1fa2..f733680 100644 --- a/Engine/Source/Runtime/Core/public/Math/Vector4.hpp +++ b/Engine/Source/Runtime/Core/public/Math/Vector4.hpp @@ -745,7 +745,7 @@ namespace Phanes::Core::Math template TVector4 Reflect(const TVector4& v1, const TVector4 normal) { - return v1 - (2 * (v1 * normal) * normal); + return v1 - (2 * DotP(v1, normal) * normal); } /// @@ -759,7 +759,7 @@ namespace Phanes::Core::Math template TVector4 ReflectV(TVector4& v1, const TVector4 normal) { - Set(v1, v1 - (2 * (v1 * normal) * normal)); + Set(v1, v1 - (2 * DotP(v1, normal) * normal)); return v1; }