Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-01-21 20:43:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-21 20:43:04 +0400
commit8cde4e5182fd2bf2bab393db32c0fa460874f82b (patch)
tree1686f1a2edece343c422c318894e0acf1fb017e2 /source/blender/blenlib
parentbcdbc579943f21bbd2f4005c7de265d6ee6dc9f9 (diff)
add an influence slider to mesh cache.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_vector.h1
-rw-r--r--source/blender/blenlib/intern/math_vector.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index e9217728eae..42a6b90f738 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -255,6 +255,7 @@ 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 msub_vn_vn(float *array_tar, const float *array_src, const float f, const int size);
void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size);
+void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size);
void fill_vn_i(int *array_tar, const int size, const int val);
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
void fill_vn_fl(float *array_tar, const int size, const float val);
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 743d1fc497b..490ed2a99fb 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -711,6 +711,19 @@ void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array
}
}
+void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size)
+{
+ const float s = 1.0f - t;
+ float *tar = array_tar + (size - 1);
+ const float *src = array_src + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar) = (s * *(tar)) + (t * *(src));
+ tar--;
+ src--;
+ }
+}
+
void fill_vn_i(int *array_tar, const int size, const int val)
{
int *tar = array_tar + (size - 1);