diff --git a/public/mathlib/vector.h b/public/mathlib/vector.h index edef6df5..9b2e0dbd 100644 --- a/public/mathlib/vector.h +++ b/public/mathlib/vector.h @@ -129,6 +129,7 @@ public: } vec_t NormalizeInPlace(); + Vector Normalized() const; bool IsLengthGreaterThan( float val ) const; bool IsLengthLessThan( float val ) const; @@ -2220,6 +2221,13 @@ inline vec_t Vector::NormalizeInPlace() return VectorNormalize( *this ); } +inline Vector Vector::Normalized() const +{ + Vector norm = *this; + VectorNormalize( norm ); + return norm; +} + inline bool Vector::IsLengthGreaterThan( float val ) const { return LengthSqr() > val*val;