From 3366cd0ff80c7770ef280858992b7c707f0890d2 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Sat, 28 Mar 2020 17:02:44 +0300 Subject: WaterCannon done, resource ico --- src/math/Vector.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/math/Vector.h') diff --git a/src/math/Vector.h b/src/math/Vector.h index cd436123..6f544ada 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -38,6 +38,14 @@ public: }else x = 1.0f; } + + void Normalise(float norm) { + float sq = MagnitudeSqr(); + float invsqrt = RecipSqrt(norm, sq); + x *= invsqrt; + y *= invsqrt; + z *= invsqrt; + } const CVector &operator+=(CVector const &right) { x += right.x; -- cgit v1.2.3