diff options
author | Ton Roosendaal <ton@blender.org> | 2005-11-17 22:34:32 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-11-17 22:34:32 +0300 |
commit | 824ed2e04100332f9c68b4a1ebed077d6cc80972 (patch) | |
tree | 0625fe451ac1babed4298e07b1dca31701a38dc4 /source/blender/blenkernel/intern/curve.c | |
parent | 43ac5834b60096cd6dae4447f366987f57b8faae (diff) |
A year-zero bug, and actually another issue with auto-handles for Ipo
curves. On sharp 'peaking' curves the handle was calculated
using both X and Y distance. This could result in overshooting.
New code only evaluates the X distance, resulting in much more moderate
sized handles.
Thanks Gabio for the demo file!
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 9cdc8be9e57..d0f46bfbaa8 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1956,7 +1956,8 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) dy= p2[1]- p1[1]; dz= p2[2]- p1[2]; } - len1= (float)sqrt(dx*dx+dy*dy+dz*dz); + if(mode) len1= dx; + else len1= (float)sqrt(dx*dx+dy*dy+dz*dz); if(mode && bezt->h2==HD_AUTO && next) { dx1= (p3[0]+p3[-3])/2.0f - p2[0]; @@ -1968,7 +1969,8 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) dy1= p3[1]- p2[1]; dz1= p3[2]- p2[2]; } - len2= (float)sqrt(dx1*dx1+dy1*dy1+dz1*dz1); + if(mode) len2= dx1; + else len2= (float)sqrt(dx1*dx1+dy1*dy1+dz1*dz1); if(len1==0.0f) len1=1.0f; if(len2==0.0f) len2=1.0f; |