mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Add component-wise vector and quaternion division.
Mostly for non-uniform scaling.
This commit is contained in:
parent
215d2e9747
commit
724427a976
1 changed files with 13 additions and 0 deletions
|
@ -110,6 +110,12 @@ extern const vec_t *const quat_origin;
|
|||
(c)[1] = (a)[1] * (b)[1]; \
|
||||
(c)[2] = (a)[2] * (b)[2]; \
|
||||
} while (0)
|
||||
#define VectorCompDiv(a,b,c) \
|
||||
do { \
|
||||
(c)[0] = (a)[0] / (b)[0]; \
|
||||
(c)[1] = (a)[1] / (b)[1]; \
|
||||
(c)[2] = (a)[2] / (b)[2]; \
|
||||
} while (0)
|
||||
#define VectorCompCompare(x, op, y) \
|
||||
(((x)[0] op (y)[0]) && ((x)[1] op (y)[1]) && ((x)[2] op (y)[2]))
|
||||
#define VectorCompare(x, y) VectorCompCompare (x, ==, y)
|
||||
|
@ -230,6 +236,13 @@ extern const vec_t *const quat_origin;
|
|||
(c)[2] = (a)[2] * (b)[2]; \
|
||||
(c)[3] = (a)[3] * (b)[3]; \
|
||||
} while (0)
|
||||
#define QuatCompDiv(a,b,c) \
|
||||
do { \
|
||||
(c)[0] = (a)[0] / (b)[0]; \
|
||||
(c)[1] = (a)[1] / (b)[1]; \
|
||||
(c)[2] = (a)[2] / (b)[2]; \
|
||||
(c)[3] = (a)[3] / (b)[3]; \
|
||||
} while (0)
|
||||
#define QuatCompCompare(x, op, y) \
|
||||
(((x)[0] op (y)[0]) && ((x)[1] op (y)[1]) \
|
||||
&& ((x)[2] op (y)[2]) && ((x)[3] op (y)[3]))
|
||||
|
|
Loading…
Reference in a new issue