]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.c
VectorVectors: renormalize 'up' vector as it seems to be unnormalized in some cases...
[xonotic/darkplaces.git] / 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)