diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-18 11:27:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-18 11:27:11 +0400 |
commit | 414370b8d42324878485e569fc332b814131887f (patch) | |
tree | 84b9b3077cccc3a5237bb8c033b6b39859cf9538 /source/blender/blenlib/intern/math_vector.c | |
parent | bfdaa3b187b947a0efcf3a02cb70bbe8aff5e301 (diff) |
Support for arbitrary sized vectors - (was limited by 2-4 previously)
patch http://codereview.appspot.com/5482043
from Andrew Hale
* Text from the submission *
This patch adds the ability to use arbitrary sized vectors from mathutils.
Currently vectors are only of size 2, 3 or 4 since they are generally restricted
to geometric applications. However, we can use arbitrary sized vectors for
efficient calculations and data manipulation.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index a9ea90ef555..590a48e8085 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -416,6 +416,15 @@ void range_vn_i(int *array_tar, const int size, const int start) while(i--) { *(array_pt--) = j--; } } +void range_vn_fl(float *array_tar, const int size, const float start, const float step) +{ + float *array_pt= array_tar + (size-1); + int i= size; + while(i--) { + *(array_pt--) = start + step * (float)(i); + } +} + void negate_vn(float *array_tar, const int size) { float *array_pt= array_tar + (size-1); |