From 8808eba3ffb5d71006987099518a1664a5f65904 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 13 Oct 2010 20:50:45 +0900 Subject: [PATCH] add VectorSet macro VectorSet(a,b,c,d) -> vec3_t d = (a, b, c) This should be useful. --- include/QF/mathlib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/QF/mathlib.h b/include/QF/mathlib.h index 164711bc9..3cce24532 100644 --- a/include/QF/mathlib.h +++ b/include/QF/mathlib.h @@ -99,6 +99,12 @@ extern const vec_t * const vec3_origin; #define VectorIsZero(a) (!(a)[0] && !(a)[1] && !(a)[2]) #define VectorZero(a) ((a)[2] = (a)[1] = (a)[0] = 0); +#define VectorSet(a,b,c,d) \ + do { \ + (d)[0] = a; \ + (d)[1] = b; \ + (d)[2] = c; \ + } while (0) #define VectorBlend(v1,v2,b,v) \ do { \