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:
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 8be066bb0e9..bb32b511005 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -1145,6 +1145,19 @@ MINLINE float len_v3v3(const float a[3], const float b[3])
return len_v3(d);
}
+MINLINE float len_v4(const float a[4])
+{
+ return sqrtf(dot_v4v4(a, a));
+}
+
+MINLINE float len_v4v4(const float a[4], const float b[4])
+{
+ float d[4];
+
+ sub_v4_v4v4(d, b, a);
+ return len_v4(d);
+}
+
/**
* \note any vectors containing `nan` will be zeroed out.
*/