diff --git a/examples/circleStack.js b/examples/circleStack.js index 9065ddfe..5b900944 100644 --- a/examples/circleStack.js +++ b/examples/circleStack.js @@ -8,11 +8,11 @@ var engine = demo.engine, world = engine.world; - var stack = Composites.stack(100, 100, 10, 10, 20, 0, function(x, y) { + var stack = Composites.stack(100, 185, 10, 10, 20, 0, function(x, y) { return Bodies.circle(x, y, 20); }); World.add(world, stack); }; -})(); \ No newline at end of file +})(); diff --git a/examples/compoundStack.js b/examples/compoundStack.js index 991a9188..f850760a 100644 --- a/examples/compoundStack.js +++ b/examples/compoundStack.js @@ -10,7 +10,7 @@ world = engine.world, size = 50; - var stack = Composites.stack(100, 220, 12, 6, 0, 0, function(x, y) { + var stack = Composites.stack(100, 280, 12, 6, 0, 0, function(x, y) { var partA = Bodies.rectangle(x, y, size, size / 5), partB = Bodies.rectangle(x, y, size / 5, size, { render: partA.render }); @@ -22,4 +22,4 @@ World.add(world, stack); }; -})(); \ No newline at end of file +})(); diff --git a/examples/softBody.js b/examples/softBody.js index 8415c909..df3d7446 100644 --- a/examples/softBody.js +++ b/examples/softBody.js @@ -15,7 +15,7 @@ World.add(world, [ Composites.softBody(250, 100, 5, 5, 0, 0, true, 18, particleOptions), - Composites.softBody(250, 300, 8, 3, 0, 0, true, 15, particleOptions), + Composites.softBody(400, 300, 8, 3, 0, 0, true, 15, particleOptions), Composites.softBody(250, 400, 4, 4, 0, 0, true, 15, particleOptions) ]); @@ -23,4 +23,4 @@ renderOptions.showAngleIndicator = false; }; -})(); \ No newline at end of file +})(); diff --git a/examples/stack.js b/examples/stack.js index c5c33d01..8dcdfc7d 100644 --- a/examples/stack.js +++ b/examples/stack.js @@ -8,11 +8,11 @@ var engine = demo.engine, world = engine.world; - var stack = Composites.stack(100, 300, 10, 5, 0, 0, function(x, y) { + var stack = Composites.stack(100, 380, 10, 5, 0, 0, function(x, y) { return Bodies.rectangle(x, y, 40, 40); }); World.add(world, stack); }; -})(); \ No newline at end of file +})(); diff --git a/src/factory/Composites.js b/src/factory/Composites.js index e86c5817..a13e330c 100644 --- a/src/factory/Composites.js +++ b/src/factory/Composites.js @@ -213,7 +213,7 @@ var Bodies = require('./Bodies'); for (var i = 0; i < number; i++) { var separation = 1.9, circle = Bodies.circle(xx + i * (size * separation), yy + length, size, - { inertia: 99999, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 0.01 }), + { inertia: Infinity, restitution: 1, friction: 0, frictionAir: 0.0001, slop: 1 }), constraint = Constraint.create({ pointA: { x: xx + i * (size * separation), y: yy }, bodyB: circle }); Composite.addBody(newtonsCradle, circle); diff --git a/src/render/Render.js b/src/render/Render.js index efa9da12..e8f29bde 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -434,6 +434,9 @@ var Vector = require('../geometry/Vector'); for (k = body.parts.length > 1 ? 1 : 0; k < body.parts.length; k++) { part = body.parts[k]; + if (!part.render.visible) + continue; + if (part.render.sprite && part.render.sprite.texture && !options.wireframes) { // part sprite var sprite = part.render.sprite,