add VectorSet macro

VectorSet(a,b,c,d) -> vec3_t d = (a, b, c)

This should be useful.
This commit is contained in:
Bill Currie 2010-08-21 19:41:45 +09:00
parent 610f32e334
commit fe9fdd7b83

View file

@ -99,6 +99,12 @@ extern const vec_t * const vec3_origin;
#define VectorIsZero(a) (!(a)[0] && !(a)[1] && !(a)[2]) #define VectorIsZero(a) (!(a)[0] && !(a)[1] && !(a)[2])
#define VectorZero(a) ((a)[2] = (a)[1] = (a)[0] = 0); #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) \ #define VectorBlend(v1,v2,b,v) \
do { \ do { \