mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-16 01:24:25 +02:00
better stopping on exploding nodes
This commit is contained in:
parent
79522a3560
commit
42c86d4f10
3 changed files with 18 additions and 307 deletions
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue