mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-24 13:29:01 -05:00
improved Example.newtonsCradle
This commit is contained in:
parent
bf90bdd38c
commit
b2bd492d05
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ Example.newtonsCradle.newtonsCradle = function(xx, yy, number, size, length) {
|
||||||
for (var i = 0; i < number; i++) {
|
for (var i = 0; i < number; i++) {
|
||||||
var separation = 1.9,
|
var separation = 1.9,
|
||||||
circle = Bodies.circle(xx + i * (size * separation), yy + length, size,
|
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 });
|
constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle });
|
||||||
|
|
||||||
Composite.addBody(newtonsCradle, circle);
|
Composite.addBody(newtonsCradle, circle);
|
||||||
|
|
Loading…
Reference in a new issue