From 399fcc6085a339ac51cc46218a3ac9cbcc945749 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 22 Jul 2003 18:44:34 +0000 Subject: [PATCH] added VectorLerp git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3310 d7cf8633-e32d-0410-b094-e92efae38249 --- mathlib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mathlib.h b/mathlib.h index ba362ce3..a005cc2b 100644 --- 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 -- 2.39.2