diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-09 12:16:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-09 12:16:04 +0300 |
commit | d31ebbe66681cda8e94c6593e4b40c4b4df5809c (patch) | |
tree | dbfe940f8cbde15efa5545a21d33c0dbeae91516 /source/blender/blenlib/intern | |
parent | ca89269c227607923bcfd8c137c552bdb0c37c16 (diff) |
cleanup for mathutils multiplication functions, a little faster in some cases, raise more informative exceptions.
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index 2ff1e948317..539d3fb97f6 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -398,6 +398,24 @@ void add_vn_vn(float *array_tar, const float *array_src, const int size) while(i--) { *(tar--) += *(src--); } } +void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size) +{ + float *tar= array_tar + (size-1); + const float *src_a= array_src_a + (size-1); + const float *src_b= array_src_b + (size-1); + int i= size; + while(i--) { *(tar--) = *(src_a--) + *(src_b--); } +} + +void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size) +{ + float *tar= array_tar + (size-1); + const float *src_a= array_src_a + (size-1); + const float *src_b= array_src_b + (size-1); + int i= size; + while(i--) { *(tar--) = *(src_a--) - *(src_b--); } +} + void fill_vni(int *array_tar, const int size, const int val) { int *tar= array_tar + (size-1); |