From: havoc Date: Fri, 21 Feb 2003 09:22:58 +0000 (+0000) Subject: added VectorMultiply (not used by anything, but for completeness...) X-Git-Tag: xonotic-v0.1.0preview~6754 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b3371efb205cd8ac7533cff6598984b1dfa6ad54;p=xonotic%2Fdarkplaces.git added VectorMultiply (not used by anything, but for completeness...) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2774 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/mathlib.h b/mathlib.h index c4d82865..d99a2d41 100644 --- a/mathlib.h +++ b/mathlib.h @@ -62,6 +62,7 @@ extern vec3_t vec3_origin; #define VectorSubtract(a,b,c) ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2]) #define VectorAdd(a,b,c) ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2]) #define VectorCopy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2]) +#define VectorMultiply(a,b,c) ((c)[0]=(a)[0]*(b)[0],(c)[1]=(a)[1]*(b)[1],(c)[2]=(a)[2]*(b)[2]) #define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0]) #define VectorNormalize(v) {float ilength = (float) sqrt(DotProduct(v,v));if (ilength) ilength = 1.0f / ilength;v[0] *= ilength;v[1] *= ilength;v[2] *= ilength;} #define VectorNormalize2(v,dest) {float ilength = (float) sqrt(DotProduct(v,v));if (ilength) ilength = 1.0f / ilength;dest[0] = v[0] * ilength;dest[1] = v[1] * ilength;dest[2] = v[2] * ilength;}