better stopping on exploding nodes

This commit is contained in:
Peter Cottle 2012-12-20 15:10:33 -08:00
parent 79522a3560
commit 42c86d4f10
3 changed files with 18 additions and 307 deletions

View file

@ -391,7 +391,12 @@ var VisNode = VisBase.extend({
cy: y
});
// continuation calculation
return ((vx * vx + vy * vy) > 0.01) ? true : false;
if ((vx * vx + vy * vy) < 0.01 && Math.abs(y - maxHeight) === 0) {
// dont need to animate anymore, we are on ground
return false;
}
// keep animating!
return true;
};
return stepFunc;
},