diff options
Diffstat (limited to '')
-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 4f74fac9..04fab797 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); |