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_geom_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_geom_inline.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_geom_inline.c b/source/blender/blenlib/intern/math_geom_inline.c
index 44b17681540..68a2e68db4f 100644
--- a/source/blender/blenlib/intern/math_geom_inline.c
+++ b/source/blender/blenlib/intern/math_geom_inline.c
@@ -199,6 +199,17 @@ MINLINE int axis_dominant_v3_single(const float vec[3])
((y > z) ? 1 : 2));
}
+/* the dominant axis of an orthogonal vector */
+MINLINE int axis_dominant_v3_ortho_single(const float vec[3])
+{
+ const float x = fabsf(vec[0]);
+ const float y = fabsf(vec[1]);
+ const float z = fabsf(vec[2]);
+ return ((x < y) ?
+ ((x < z) ? 0 : 2) :
+ ((y < z) ? 1 : 2));
+}
+
MINLINE int max_axis_v3(const float vec[3])
{
const float x = vec[0];