diff options
author | aap <aap@papnet.eu> | 2020-03-28 16:47:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 16:47:20 +0100 |
commit | a58bceb1a736dd76fbdaee8747276fe755755d1a (patch) | |
tree | dae35ada030479401faa42b0d518e460c1635406 /src/math/Vector.h | |
parent | CCam fix (diff) | |
parent | WaterCannon uv macros (diff) | |
download | re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.tar re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.tar.gz re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.tar.bz2 re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.tar.lz re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.tar.xz re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.tar.zst re3-a58bceb1a736dd76fbdaee8747276fe755755d1a.zip |
Diffstat (limited to 'src/math/Vector.h')
-rw-r--r-- | src/math/Vector.h | 8 |
1 files changed, 8 insertions, 0 deletions
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; |