diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-05 09:14:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-05 09:14:50 +0300 |
commit | dd08305e7506233611315dc6c60013fbac30b53d (patch) | |
tree | fb9e9d1e65ec790d20a51056aa3ab98766b2a68f /source/blender/blenlib | |
parent | f2a6395e21c723843c0e44bba22de0c7aa1a3d08 (diff) |
Rename python mathutils functions and split in-place methods from those that return new values.
http://wiki.blender.org/index.php/Dev:2.5/Source/Python/Mathutils
This completes the changes proposed.
This will break scripts (fixing coming up next), for full list of changes see mathutils.c comments.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 4d8a4f2bbaf..d6d9c0a1c22 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -173,6 +173,8 @@ void minmax_v3v3_v3(float min[3], float max[3], const float vec[3]); /***************************** Array Functions *******************************/ /* attempted to follow fixed length vertex functions. names could be improved*/ void range_vni(int *array, const int size, const int start); +void negate_vn(float *array_tar, const int size); +void negate_vn_vn(float *array_tar, const float *array_src, const int size); void mul_vn_fl(float *array, const int size, const float f); void mul_vn_vn_fl(float *array_tar, const float *array_src, const int size, const float f); void add_vn_vn(float *array_tar, const float *array_src, const int size); diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index 37a68cb0fca..bcad7894e86 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -375,6 +375,21 @@ void range_vni(int *array_tar, const int size, const int start) while(i--) { *(array_pt--) = j--; } } +void negate_vn(float *array_tar, const int size) +{ + float *array_pt= array_tar + (size-1); + int i= size; + while(i--) { *(array_pt--) *= -1.0f; } +} + +void negate_vn_vn(float *array_tar, const float *array_src, const int size) +{ + float *tar= array_tar + (size-1); + const float *src= array_src + (size-1); + int i= size; + while(i--) { *(tar--) = - *(src--); } +} + void mul_vn_fl(float *array_tar, const int size, const float f) { float *array_pt= array_tar + (size-1); |