From b2bd492d0516222f8440446da3538db3c58f1a29 Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 29 Dec 2021 23:08:46 +0000 Subject: [PATCH] improved Example.newtonsCradle --- examples/newtonsCradle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/newtonsCradle.js b/examples/newtonsCradle.js index 7aaf66a..049cecf 100644 --- a/examples/newtonsCradle.js +++ b/examples/newtonsCradle.js @@ -99,7 +99,7 @@ Example.newtonsCradle.newtonsCradle = function(xx, yy, number, size, length) { for (var i = 0; i < number; i++) { var separation = 1.9, circle = Bodies.circle(xx + i * (size * separation), yy + length, size, - { inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }), + { inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0, slop: size * 0.02 }), constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle }); Composite.addBody(newtonsCradle, circle);