diff --git a/Source/Engine/Core/Math/Vector4.h b/Source/Engine/Core/Math/Vector4.h index 5f5e436ad..167937c81 100644 --- a/Source/Engine/Core/Math/Vector4.h +++ b/Source/Engine/Core/Math/Vector4.h @@ -153,6 +153,12 @@ public: return Math::IsOne(X) && Math::IsOne(Y) && Math::IsOne(Z) && Math::IsOne(W); } + // Calculates the length of the vector. + T Length() const + { + return Math::Sqrt(X * X + Y * Y + Z * Z + W * W); + } + /// /// Returns the average arithmetic of all the components. ///