diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-19 16:12:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-19 16:17:10 +0400 |
commit | a51a0ca772b21814e29bdb3b2b5fd854e29c5334 (patch) | |
tree | 134e4517c0a8cbd2ee05bb56d223e0922820e06e /source/blender/blenlib/intern/math_base_inline.c | |
parent | 9c93c0bf08c0bc73d2c09e7f8c57721b557eb222 (diff) |
Math Lib: add shell_v3v3_normalized_to_dist and v2 version
bypass angle calculation to avoids (asin, sqrt, cos).
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 82c6e68ccc2..e6217329145 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -44,9 +44,6 @@ # define UNLIKELY(x) (x) #endif -/* A few small defines. Keep'em local! */ -#define SMALL_NUMBER 1.e-8f - MINLINE float sqrt3f(float f) { if (UNLIKELY(f == 0.0f)) return 0.0f; @@ -111,15 +108,6 @@ MINLINE float interpf(float target, float origin, float fac) return (fac * target) + (1.0f - fac) * origin; } -/* useful to calculate an even width shell, by taking the angle between 2 planes. - * The return value is a scale on the offset. - * no angle between planes is 1.0, as the angle between the 2 planes approaches 180d - * the distance gets very high, 180d would be inf, but this case isn't valid */ -MINLINE float shell_angle_to_dist(const float angle) -{ - return (UNLIKELY(angle < SMALL_NUMBER)) ? 1.0f : fabsf(1.0f / cosf(angle)); -} - /* used for zoom values*/ MINLINE float power_of_2(float val) { |