Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-07-14 05:55:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-07-14 05:55:38 +0400
commitd9f39257f40d58caa53efcad112df9775f95d8bf (patch)
tree034569c38838000ad18290aa211a25946b66bc08 /source/blender/blenlib/intern/math_vector_inline.c
parentd56e6bf1bf82c2112913442e1a416fb6ebcc9fa5 (diff)
Math Lib: add compare_len_squared_v3v3 from paint branch
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 4a18987e2e4..135050f4a3f 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -934,6 +934,17 @@ MINLINE bool compare_len_v3v3(const float v1[3], const float v2[3], const float
return ((x * x + y * y + z * z) <= (limit * limit));
}
+MINLINE bool compare_len_squared_v3v3(const float v1[3], const float v2[3], const float limit_sq)
+{
+ float x, y, z;
+
+ x = v1[0] - v2[0];
+ y = v1[1] - v2[1];
+ z = v1[2] - v2[2];
+
+ return ((x * x + y * y + z * z) <= limit_sq);
+}
+
MINLINE bool compare_v4v4(const float v1[4], const float v2[4], const float limit)
{
if (fabsf(v1[0] - v2[0]) <= limit)