diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2020-04-15 07:03:53 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2020-04-15 07:03:53 +0200 |
commit | daed13485ef47d9c8992e53e1a976fba237fca50 (patch) | |
tree | f8116c26ac5f95a77375d67daffddbeaa19177e0 /src/math/Vector.h | |
parent | fix weather init (diff) | |
download | re3-daed13485ef47d9c8992e53e1a976fba237fca50.tar re3-daed13485ef47d9c8992e53e1a976fba237fca50.tar.gz re3-daed13485ef47d9c8992e53e1a976fba237fca50.tar.bz2 re3-daed13485ef47d9c8992e53e1a976fba237fca50.tar.lz re3-daed13485ef47d9c8992e53e1a976fba237fca50.tar.xz re3-daed13485ef47d9c8992e53e1a976fba237fca50.tar.zst re3-daed13485ef47d9c8992e53e1a976fba237fca50.zip |
Diffstat (limited to '')
-rw-r--r-- | src/math/Vector.h | 7 |
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; |