Closed donaldducky closed 11 years ago
Fixed. Problem related to rounding on CAAT.PathUtil.Path.getPosition function. Now each segment's calculated time is clamped to a valid value which prevents this aliasing. Thanks.
Cool, thanks for quick update! Where can I get the fix? I don't see a commit related to this.
Thanks for your great work :D
Hey, as a temporary patch, you can do the following:
add
// Clamp this segment's time to a maximum since it is relative to the path.
// thanks https://github.com/donaldducky for spotting.
if (time>1) {
time=1;
} else if (time<0 ) {
time= 0;
}
in CAAT.Path.PathUtil.getPosition, just under this block:
while( l!==r ) {
m= ((r+l)/2)|0;
psstv= psst[m];
if ( psstv<=time && time<=psstv+psdt[m]) {
time= psdt[m] ?
(time-psstv)/psdt[m] :
0;
and above:
var pointInPath= ps[m].getPosition(time);
np.x= pointInPath.x;
np.y= pointInPath.y;
return np;
that will set things up. I expect to release a new version today nov 18th, but just in case.
Cool, thanks!
Just wondering how you do "releases"...do you not just commit everything and push it to github?
Yes. That's the final step. But also make sure all demos, tutorials and games I have still work after changes. This release includes retina display, which makes things a bit tougher to manage. Also more fine grained sprite animations, so new demos are on its way too. Feel free to send me some url pointing to your work in progress, either over here, or to my personal email ;)
Thanks.
2012/11/18 Don Chea notifications@github.com
Cool, thanks!
Just wondering how you do "releases"...do you not just commit everything and push it to github?
— Reply to this email directly or view it on GitHubhttps://github.com/hyperandroid/CAAT/issues/95#issuecomment-10498189.
The final position of a caat actor is incorrect when adding a path behavior to the actor containing 3 paths.
The
getPosition
function for CAAT.LinearPath is being passed a time of1.0000000000000002
and then setstime %= 1
.I'm guessing this is just a rounding error for numbers that don't divide evenly into 1 (this doesn't happen for paths with 1, 2 or 4 segments).
Here is an example below (using build/caat.js @ 65cb114bfb8d3c75b5cd7f59f8e5645fa55a6bbb ):