diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-03 18:16:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-03 18:16:27 +0400 |
commit | 157d1205a42b07042d8abdb590034940b68f0b12 (patch) | |
tree | cdf1383d103835dd094ef3f7d9df1e4018f72aa5 /source/blender/blenlib/intern/math_vector_inline.c | |
parent | ed7ffb111a7021275738c1710ca34218d851e652 (diff) |
added len_squared_v2v2, use instead of len_v3v3 for font handle tests, also fixed some warnings.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 84d96d1d22a..2f75fcead79 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -302,7 +302,7 @@ MINLINE void star_m3_v3(float mat[][3], float *vec) MINLINE float len_v2(const float v[2]) { - return (float)sqrt(v[0]*v[0] + v[1]*v[1]); + return (float)sqrtf(v[0]*v[0] + v[1]*v[1]); } MINLINE float len_v2v2(const float v1[2], const float v2[2]) @@ -311,7 +311,7 @@ MINLINE float len_v2v2(const float v1[2], const float v2[2]) x = v1[0]-v2[0]; y = v1[1]-v2[1]; - return (float)sqrt(x*x+y*y); + return (float)sqrtf(x*x+y*y); } MINLINE float len_v3(const float a[3]) @@ -319,6 +319,14 @@ MINLINE float len_v3(const float a[3]) return sqrtf(dot_v3v3(a, a)); } +MINLINE float len_squared_v2v2(const float a[3], const float b[3]) +{ + float d[2]; + + sub_v2_v2v2(d, b, a); + return dot_v2v2(d, d); +} + MINLINE float len_v3v3(const float a[3], const float b[3]) { float d[3]; |