summaryrefslogtreecommitdiff
path: root/src/math/Vector.h
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2020-04-15 08:03:53 +0300
committerFire-Head <Fire-Head@users.noreply.github.com>2020-04-15 08:03:53 +0300
commitdaed13485ef47d9c8992e53e1a976fba237fca50 (patch)
treef8116c26ac5f95a77375d67daffddbeaa19177e0 /src/math/Vector.h
parent6473778c47efa1e8c1e2d8eea405de98f378cd69 (diff)
CWeapon done, ps2 cheats fix
Diffstat (limited to 'src/math/Vector.h')
-rw-r--r--src/math/Vector.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/math/Vector.h b/src/math/Vector.h
index 6f544ada..9b732610 100644
--- a/src/math/Vector.h
+++ b/src/math/Vector.h
@@ -46,6 +46,13 @@ public:
y *= invsqrt;
z *= invsqrt;
}
+
+ void Normalise2D(void) {
+ float sq = MagnitudeSqr2D();
+ float invsqrt = RecipSqrt(sq);
+ x *= invsqrt;
+ y *= invsqrt;
+ }
const CVector &operator+=(CVector const &right) {
x += right.x;