diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-07-18 01:57:39 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-07-18 01:57:39 -0600 |
commit | a9670e8946d655105212c289322dc4eddf7986ed (patch) | |
tree | 4b0ff1c6698366ba02b721d69103b5a7ac42f762 /libdimension | |
parent | b4fb97a0aaecdb6e3ff4dc9badc51dc12211c9a1 (diff) | |
download | dimension-a9670e8946d655105212c289322dc4eddf7986ed.tar.xz |
Use dmnsn_min() and _max() in dmnsn_vector_min() and _max().
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/dimension/geometry.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h index c9f036f..5efba3a 100644 --- a/libdimension/dimension/geometry.h +++ b/libdimension/dimension/geometry.h @@ -259,21 +259,21 @@ dmnsn_vector_normalize(dmnsn_vector n) DMNSN_INLINE dmnsn_vector dmnsn_vector_min(dmnsn_vector a, dmnsn_vector b) { - dmnsn_vector ret = a; - if (b.x < ret.x) ret.x = b.x; - if (b.y < ret.y) ret.y = b.y; - if (b.z < ret.z) ret.z = b.z; - return ret; + return dmnsn_new_vector( + dmnsn_min(a.x, b.x), + dmnsn_min(a.y, b.y), + dmnsn_min(a.z, b.z) + ); } DMNSN_INLINE dmnsn_vector dmnsn_vector_max(dmnsn_vector a, dmnsn_vector b) { - dmnsn_vector ret = a; - if (b.x > ret.x) ret.x = b.x; - if (b.y > ret.y) ret.y = b.y; - if (b.z > ret.z) ret.z = b.z; - return ret; + return dmnsn_new_vector( + dmnsn_max(a.x, b.x), + dmnsn_max(a.y, b.y), + dmnsn_max(a.z, b.z) + ); } double dmnsn_vector_axis_angle(dmnsn_vector v1, dmnsn_vector v2, |