From: vortex Date: Sat, 18 Feb 2012 12:29:05 +0000 (+0000) Subject: VectorVectors: renormalize 'up' vector as it seems to be unnormalized in some cases... X-Git-Tag: xonotic-v0.8.0~96^2~319 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=52e4991331e72a3fb72e04e04608b99dc4bb1837;p=xonotic%2Fdarkplaces.git VectorVectors: renormalize 'up' vector as it seems to be unnormalized in some cases (a test case - spawning of large-scaled oriented particle). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11697 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/mathlib.c b/mathlib.c index dae0de50..129b0b8a 100644 --- 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)