diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-24 08:12:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-24 08:12:16 +0400 |
commit | c62d33c540830188207bc32d5e3fc5a2134f5ab1 (patch) | |
tree | 5d996cc183651123d518ead7d9a3a6a951c77348 /source/blender/blenlib/BLI_math_vector.h | |
parent | f94614d791b1381bc4751ad5194680cec81a4b57 (diff) |
patch: [#29382] Arbitrary Length Array Function Additions and Modifications
from Andrew Hale (trumanblending), with some edits to use these in mathutils.Vector added.
Added Functions:
- dot_vn_vn - Dot product of two arrays
- normalize_vn_vn - Normalize an array and store the result in a second array
- normalize_vn - Normalize an array inplace
Renamed Functions:
Some functions have been renamed to make them consistent with the naming conventions used by fixed length array functions.
- fill_vni to fill_vn_i
- fill_vn to fill_vn_fl
Diffstat (limited to 'source/blender/blenlib/BLI_math_vector.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 2b9d6d2d6d6..d8e880a9dec 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -194,17 +194,20 @@ 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); +double dot_vn_vn(const float *array_src_a, const float *array_src_b, const int size); +float normalize_vn_vn(float *array_tar, const float *array_src, const int size); +float normalize_vn(float *array_tar, const int size); +void range_vn_i(int *array_tar, 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_fl(float *array_tar, 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); void add_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size); void sub_vn_vn(float *array_tar, const float *array_src, const int size); void sub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const int size); -void fill_vni(int *array_tar, const int size, const int val); -void fill_vn(float *array_tar, const int size, const float val); +void fill_vn_i(int *array_tar, const int size, const int val); +void fill_vn_fl(float *array_tar, const int size, const float val); #ifdef __cplusplus } |