diff --git a/src/constraint/MouseConstraint.js b/src/constraint/MouseConstraint.js index acd1d84..7cb0830 100644 --- a/src/constraint/MouseConstraint.js +++ b/src/constraint/MouseConstraint.js @@ -31,7 +31,7 @@ var MouseConstraint = {}; mouse: mouse, dragBody: null, dragPoint: null, - constraints: [constraint] + constraint: constraint }; }; @@ -43,7 +43,7 @@ var MouseConstraint = {}; */ MouseConstraint.update = function(mouseConstraint, bodies) { var mouse = mouseConstraint.mouse, - constraint = mouseConstraint.constraints[0]; + constraint = mouseConstraint.constraint; if (mouse.button === 0 || mouse.button === 2) { if (!constraint.bodyB) { diff --git a/src/core/Engine.js b/src/core/Engine.js index f77d7c9..bb2f162 100644 --- a/src/core/Engine.js +++ b/src/core/Engine.js @@ -71,7 +71,7 @@ var Engine = {}; engine.metrics = engine.metrics || Metrics.create(); engine.input.mouse = engine.input.mouse || Mouse.create(engine.render.canvas); engine.mouseConstraint = engine.mouseConstraint || MouseConstraint.create(engine.input.mouse); - World.addComposite(engine.world, engine.mouseConstraint); + World.addConstraint(engine.world, engine.mouseConstraint.constraint); engine.broadphase = engine.broadphase || { current: 'grid', @@ -340,7 +340,7 @@ var Engine = {}; engine.pairs.table = {}; engine.pairs.list = []; - World.addComposite(engine.world, engine.mouseConstraint); + World.addConstraint(engine.world, engine.mouseConstraint.constraint); var broadphase = engine.broadphase[engine.broadphase.current];