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>2009-11-21 17:35:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-21 17:35:28 +0300
commitbd1f548d8e4a47b81b03af3d50339b2fa33ff5fb (patch)
tree4e7281db29254a9cd5b22216c3d5156c48224f0d /source/blender/blenlib/intern/math_vector.c
parent09cf0118790e7f38fc65c3fed523edb66c095674 (diff)
fix for [#19655] Curve is a disaster
when changing curve twist I assumed 2D curves would not need dir or quat values set, however these are used when getting a path from a curve. also added interp_v3_v3v3v3v3
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r--source/blender/blenlib/intern/math_vector.c9
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 8d36c3ac524..502f241c195 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -68,6 +68,15 @@ void interp_v3_v3v3v3(float p[3], float v1[3], float v2[3], float v3[3], float w
p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2];
}
+/* weight 3 vectors,
+ * 'w' must be unit length but is not a vector, just 3 weights */
+void interp_v3_v3v3v3v3(float p[3], float v1[3], float v2[3], float v3[3], float v4[3], float w[4])
+{
+ p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3];
+ p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
+ p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
+}
+
void mid_v3_v3v3(float *v, float *v1, float *v2)
{
v[0]= 0.5f*(v1[0] + v2[0]);