]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
VectorVectors: renormalize 'up' vector as it seems to be unnormalized in some cases...
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 18 Feb 2012 12:29:05 +0000 (12:29 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 18 Feb 2012 12:29:05 +0000 (12:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11697 d7cf8633-e32d-0410-b094-e92efae38249

mathlib.c

index dae0de50ba070a4f144e6830e47e5fa4da125700..129b0b8a6520f64eddca116e3ce8960a61f8501e 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -208,6 +208,7 @@ void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up)
        VectorMA(right, -d, forward, right);
        VectorNormalize(right);
        CrossProduct(right, forward, up);
+       VectorNormalize(up); // CrossProduct in this case returns 'up thats length is not 1
 }
 
 void VectorVectorsDouble(const double *forward, double *right, double *up)