[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16994] trunk/blender/source/blender/ blenkernel/intern/key.c: Bugfix #11712
Ton Roosendaal
ton at blender.org
Thu Oct 9 16:28:17 CEST 2008
Revision: 16994
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16994
Author: ton
Date: 2008-10-09 16:28:17 +0200 (Thu, 09 Oct 2008)
Log Message:
-----------
Bugfix #11712
Definitely one of the oldest bugs ever (1995 or so).
Case is a path (child on path, or deformer, or motion modifier) where the
child is far away from path (300 units or so). In that case you can see
the path jumping to another position a bit after a few frames.
Reason:
For interpolating path positions, I was using bspline code still having a
very ancient constant 0.1666f.
Floats have higher precision, like 0.16666666. That solved it :)
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/key.c
Modified: trunk/blender/source/blender/blenkernel/intern/key.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/key.c 2008-10-09 12:19:16 UTC (rev 16993)
+++ trunk/blender/source/blender/blenkernel/intern/key.c 2008-10-09 14:28:17 UTC (rev 16994)
@@ -284,10 +284,10 @@
}
else if(type==KEY_BSPLINE) {
- data[0]= -0.1666f*d3 +0.5f*d2 -0.5f*d +0.16666f;
- data[1]= 0.5f*d3 -d2 +0.6666f;
- data[2]= -0.5f*d3 +0.5f*d2 +0.5f*d +0.1666f;
- data[3]= 0.1666f*d3 ;
+ data[0]= -0.16666666f*d3 +0.5f*d2 -0.5f*d +0.16666666f;
+ data[1]= 0.5f*d3 -d2 +0.6666666f;
+ data[2]= -0.5f*d3 +0.5f*d2 +0.5f*d +0.16666666f;
+ data[3]= 0.16666666f*d3 ;
}
}
}
@@ -313,10 +313,10 @@
}
else if(type==KEY_BSPLINE) {
- data[0]= -0.1666f*3.0f*d2 +d -0.5f;
+ data[0]= -0.16666666f*3.0f*d2 +d -0.5f;
data[1]= 1.5f*d2 -2.0f*d;
data[2]= -1.5f*d2 +d +0.5f;
- data[3]= 0.1666f*3.0f*d2 ;
+ data[3]= 0.16666666f*3.0f*d2 ;
}
}
}
More information about the Bf-blender-cvs
mailing list