diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-23 20:32:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-23 20:32:39 +0400 |
commit | e038a1c613009d81adda0662dbb1e4a38228909a (patch) | |
tree | be5851f67fda72085c51abd762fb81dd521f1e05 /source/blender/blenlib/intern/math_geom_inline.c | |
parent | fec81d9b56075f46f6dde196ac85140872cff74e (diff) |
reduce float comparisons for keying operation and despill.
Diffstat (limited to 'source/blender/blenlib/intern/math_geom_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_geom_inline.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_geom_inline.c b/source/blender/blenlib/intern/math_geom_inline.c index 0d4c797cefb..bbf6dc9dfc2 100644 --- a/source/blender/blenlib/intern/math_geom_inline.c +++ b/source/blender/blenlib/intern/math_geom_inline.c @@ -137,4 +137,28 @@ MINLINE void madd_sh_shfl(float r[9], const float sh[9], const float f) add_sh_shsh(r, r, tmp); } +MINLINE int axis_primary_v3(const float vec[3]) +{ + const float x = vec[0]; + const float y = vec[1]; + const float z = vec[2]; + + if (x > y) { + if (x > z) { + return 0; + } + else { + return 2; + } + } + else { + if (y > z) { + return 1; + } + else { + return 2; + } + } +} + #endif /* __MATH_GEOM_INLINE_C__ */ |