0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

added constraint to Demo.compound

This commit is contained in:
liabru 2015-04-21 21:17:38 +01:00
parent 6679b9c6c5
commit 87fbf51c82

View file

@ -137,6 +137,7 @@
size = 150;
x = 400;
y = 300;
var partC = Bodies.circle(x, y, 30),
partD = Bodies.circle(x + size, y, 30),
@ -147,7 +148,13 @@
parts: [partC, partD, partE, partF]
});
World.add(_world, [compoundBodyA, compoundBodyB]);
var constraint = Constraint.create({
pointA: { x: 400, y: 100 },
bodyB: compoundBodyB,
pointB: { x: 0, y: -50 }
});
World.add(_world, [compoundBodyA, compoundBodyB, constraint]);
var renderOptions = _engine.render.options;
renderOptions.showAxes = true;