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.7.0~206 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6de3a631f63c5f530dd6b46235cc9e3cb064240a;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 ::stable-branch::merge=52e4991331e72a3fb72e04e04608b99dc4bb1837 --- diff --git a/mathlib.c b/mathlib.c index 3bb17628..ed0a43c6 100644 --- a/mathlib.c +++ b/mathlib.c @@ -212,6 +212,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)