From c62d33c540830188207bc32d5e3fc5a2134f5ab1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 24 Nov 2011 04:12:16 +0000 Subject: 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 --- source/blender/blenlib/BLI_math_vector.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/blender/blenlib/BLI_math_vector.h') 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 } -- cgit v1.2.3