]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added VectorLerp
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Jul 2003 18:44:34 +0000 (18:44 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Jul 2003 18:44:34 +0000 (18:44 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3310 d7cf8633-e32d-0410-b094-e92efae38249

mathlib.h

index ba362ce32b4262c9b27d3ed19b791e83b19db278..a005cc2b9bb2a4aa9b1a99d1f55e237474f701ed 100644 (file)
--- a/mathlib.h
+++ b/mathlib.h
@@ -92,6 +92,7 @@ extern vec3_t vec3_origin;
 }
 #define VectorRandom(v) do{(v)[0] = lhrandom(-1, 1);(v)[1] = lhrandom(-1, 1);(v)[2] = lhrandom(-1, 1);}while(DotProduct(v, v) > 1)
 #define VectorBlend(b1, b2, blend, c) do{float iblend = 1 - (blend);VectorMAM(iblend, b1, blend, b2, c);}while(0)
+#define VectorLerp(v1,lerp,v2,c) ((c)[0] = (v1)[0] + (lerp) * ((v2)[0] - (v1)[0]), (c)[1] = (v1)[1] + (lerp) * ((v2)[1] - (v1)[1]), (c)[2] = (v1)[2] + (lerp) * ((v2)[2] - (v1)[2]))
 #define BoxesOverlap(a,b,c,d) ((a)[0] <= (d)[0] && (b)[0] >= (c)[0] && (a)[1] <= (d)[1] && (b)[1] >= (c)[1] && (a)[2] <= (d)[2] && (b)[2] >= (c)[2])
 
 // fast PointInfrontOfTriangle