diff --git a/Source/Engine/Core/Math/Vector2.h b/Source/Engine/Core/Math/Vector2.h index 2f7a143c4..32372e42d 100644 --- a/Source/Engine/Core/Math/Vector2.h +++ b/Source/Engine/Core/Math/Vector2.h @@ -228,8 +228,9 @@ public: /// Vector2Base GetNormalized() const { - const T rcp = 1.0f / Length(); - return Vector2Base(X * rcp, Y * rcp); + Vector2Base Result(X, Y); + Result.Normalize(); + return Result; } public: diff --git a/Source/Engine/Core/Math/Vector3.h b/Source/Engine/Core/Math/Vector3.h index 18daa8934..ff548316a 100644 --- a/Source/Engine/Core/Math/Vector3.h +++ b/Source/Engine/Core/Math/Vector3.h @@ -254,8 +254,9 @@ public: /// Vector3Base GetNormalized() const { - const T rcp = 1.0f / Length(); - return Vector3Base(X * rcp, Y * rcp, Z * rcp); + Vector3Base Result(X, Y, Z); + Result.Normalize(); + return Result; } public: