mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Add macros to ease printing of vectors and quaternions.
I got sick of having to pass all those parameters to printf. Let the compiler do it for me.
This commit is contained in:
parent
a3f0a559a5
commit
94362cc010
1 changed files with 6 additions and 0 deletions
|
@ -114,6 +114,9 @@ extern const vec_t * const quat_origin;
|
|||
(v)[2] = (v1)[2] * (1 - (b)) + (v2)[2] * (b); \
|
||||
} while (0)
|
||||
|
||||
//For printf etc
|
||||
#define VectorExpand(v) (v)[0], (v)[1], (v)[2]
|
||||
|
||||
#define QDotProduct(a,b) ((a)[0] * (b)[0] + (a)[1] * (b)[1] \
|
||||
+ (a)[2] * (b)[2] + (a)[3] * (b)[3])
|
||||
#define QuatSubtract(a,b,c) \
|
||||
|
@ -196,6 +199,9 @@ extern const vec_t * const quat_origin;
|
|||
(v)[3] = (v1)[3] * (1 - (b)) + (v2)[3] * (b); \
|
||||
} while (0)
|
||||
|
||||
//For printf etc
|
||||
#define QuatExpand(q) (q)[0], (q)[1], (q)[2], (q)[3]
|
||||
|
||||
/*
|
||||
* VectorDistance, the distance between two points.
|
||||
* Yes, this is the same as sqrt(VectorSubtract then DotProduct),
|
||||
|
|
Loading…
Reference in a new issue