diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-29 16:16:37 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-30 14:11:03 +0300 |
commit | 4f395c84fe9f05b59b81be36b464521bcf92331e (patch) | |
tree | c3a49b357b092cfad34a4c2d3a6266f7caab0f89 /source | |
parent | 0f372f3966c434da5faa8e221f9da2aa48999a61 (diff) |
BLI_math_vector: Add equals_v4v4_int
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index aa639cd3a5d..3399287dd46 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -338,6 +338,7 @@ MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RE MINLINE bool equals_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT; MINLINE bool equals_v2v2_int(const int v1[2], const int v2[2]) ATTR_WARN_UNUSED_RESULT; +MINLINE bool equals_v4v4_int(const int v1[4], const int v2[4]) ATTR_WARN_UNUSED_RESULT; MINLINE bool compare_v2v2(const float a[2], const float b[2], diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 598a22f6aa3..13a87b9ec6a 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -1313,6 +1313,11 @@ MINLINE bool equals_v2v2_int(const int v1[2], const int v2[2]) return ((v1[0] == v2[0]) && (v1[1] == v2[1])); } +MINLINE bool equals_v4v4_int(const int v1[4], const int v2[4]) +{ + return ((v1[0] == v2[0]) && (v1[1] == v2[1]) && (v1[2] == v2[2]) && (v1[3] == v2[3])); +} + MINLINE bool compare_v2v2(const float v1[2], const float v2[2], const float limit) { return (compare_ff(v1[0], v2[0], limit) && compare_ff(v1[1], v2[1], limit)); |