diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-03-24 20:52:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-03-24 20:52:51 +0300 |
commit | fdfb46337cb56281db54a7faf43d4e302da6415c (patch) | |
tree | a06295949e251402a35871e1bdbc88c0b5fd68c4 /source/blender/blenlib/intern/math_vector.c | |
parent | 6ab34157fd80a9ec993f56a5e92888f66bab3cd9 (diff) |
- Use vector interpolation functions from math_vector module in
curve subdivision operator.
- Added function interp_v4_v4v4().
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index 97f5ea73ea9..8032cd64de5 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -55,6 +55,16 @@ void interp_v3_v3v3(float target[3], const float a[3], const float b[3], const f target[2]= s*a[2] + t*b[2]; } +void interp_v4_v4v4(float target[4], const float a[4], const float b[4], const float t) +{ + float s = 1.0f-t; + + target[0]= s*a[0] + t*b[0]; + target[1]= s*a[1] + t*b[1]; + target[2]= s*a[2] + t*b[2]; + target[3]= s*a[3] + t*b[3]; +} + /* weight 3 vectors, * 'w' must be unit length but is not a vector, just 3 weights */ void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3]) |