diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-22 14:10:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-22 14:10:24 +0300 |
commit | 8ec59c7c687b9e50c48a9d455b31ff4c01df69d2 (patch) | |
tree | 32bf65aad65475c5dd9aeefa9067eba21e7324fb /source/blender/blenlib/intern/math_vector.c | |
parent | 2d2339a70992b819a23e8c71f68027022b395f46 (diff) |
Math Lib:
* inline some more functions, from math_base and math_vector
* also made some changes to the way inline is done so it can
work for more than one file
* reflect_v3_v3v3 requires input vectors to be normalized now.
* added rgb_to_grayscale
* added zero_v4, copy_v4_v4, swap_v4_v4, is_one_v3
* added box_clip_bounds_m4 to clip a bounding box against a
projection matrix
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index bb7c65c4884..950d0bb21a5 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -84,50 +84,6 @@ void mid_v3_v3v3(float *v, float *v1, float *v2) v[2]= 0.5f*(v1[2] + v2[2]); } -/********************************* Comparison ********************************/ - -int is_zero_v3(float *v) -{ - return (v[0] == 0 && v[1] == 0 && v[2] == 0); -} - -int equals_v3v3(float *v1, float *v2) -{ - return ((v1[0]==v2[0]) && (v1[1]==v2[1]) && (v1[2]==v2[2])); -} - -int compare_v3v3(float *v1, float *v2, float limit) -{ - if(fabs(v1[0]-v2[0])<limit) - if(fabs(v1[1]-v2[1])<limit) - if(fabs(v1[2]-v2[2])<limit) - return 1; - - return 0; -} - -int compare_len_v3v3(float *v1, float *v2, float limit) -{ - float x,y,z; - - x=v1[0]-v2[0]; - y=v1[1]-v2[1]; - z=v1[2]-v2[2]; - - return ((x*x + y*y + z*z) < (limit*limit)); -} - -int compare_v4v4(float *v1, float *v2, float limit) -{ - if(fabs(v1[0]-v2[0])<limit) - if(fabs(v1[1]-v2[1])<limit) - if(fabs(v1[2]-v2[2])<limit) - if(fabs(v1[3]-v2[3])<limit) - return 1; - - return 0; -} - /********************************** Angles ***********************************/ /* Return the angle in radians between vecs 1-2 and 2-3 in radians @@ -297,8 +253,6 @@ void reflect_v3_v3v3(float *out, float *v1, float *v2) copy_v3_v3(vec, v1); copy_v3_v3(normal, v2); - normalize_v3(normal); - dot2 = 2 * dot_v3v3(vec, normal); reflect[0] = vec[0] - (dot2 * normal[0]); |