diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-04-17 16:31:43 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-04-17 16:31:43 +0300 |
commit | 941c50ee2573c917676c3b03f4f386d55e27396d (patch) | |
tree | 3a1f3539413c578ac140a9fb36b1f909870481ff /src/math/math.cpp | |
parent | 599164006a9e7eb7328fc194c9bae1acbb2c887d (diff) | |
parent | 6ef7924e0122155c390698bdd66e9757f4da5fa0 (diff) |
Merge remote-tracking branch 'origin/master' into Standalone
Diffstat (limited to 'src/math/math.cpp')
-rw-r--r-- | src/math/math.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/math/math.cpp b/src/math/math.cpp index e11d048c..eeb9d3fa 100644 --- a/src/math/math.cpp +++ b/src/math/math.cpp @@ -5,6 +5,19 @@ // TODO: move more stuff into here void +CVector2D::Normalise(void) +{ + float sq = MagnitudeSqr(); + assert(sq != 0.0f); // just be safe here + //if(sq > 0.0f){ + float invsqrt = RecipSqrt(sq); + x *= invsqrt; + y *= invsqrt; + //}else + // x = 1.0f; +} + +void CMatrix::SetRotate(float xAngle, float yAngle, float zAngle) { float cX = Cos(xAngle); |