0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-30 10:20:52 -05:00

improve stack examples with exact contact

This commit is contained in:
liabru 2021-01-24 22:19:49 +00:00
parent 839f7d9ebc
commit 522f4e841d
7 changed files with 7 additions and 7 deletions

View file

@ -32,7 +32,7 @@ Example.circleStack = function() {
Runner.run(runner, engine);
// add bodies
var stack = Composites.stack(100, 185, 10, 10, 20, 0, function(x, y) {
var stack = Composites.stack(100, 600 - 21 - 20 * 20, 10, 10, 20, 0, function(x, y) {
return Bodies.circle(x, y, 20);
});

View file

@ -35,7 +35,7 @@ Example.compoundStack = function() {
// add bodies
var size = 50;
var stack = Composites.stack(100, 280, 12, 6, 0, 0, function(x, y) {
var stack = Composites.stack(100, 600 - 17 - size * 6, 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 });

View file

@ -32,7 +32,7 @@ Example.pyramid = function() {
Runner.run(runner, engine);
// add bodies
var stack = Composites.pyramid(100, 258, 15, 10, 0, 0, function(x, y) {
var stack = Composites.pyramid(100, 605 - 25 - 16 * 20, 15, 10, 0, 0, function(x, y) {
return Bodies.rectangle(x, y, 40, 40);
});

View file

@ -32,7 +32,7 @@ Example.stack = function() {
Runner.run(runner, engine);
// add bodies
var stack = Composites.stack(200, 380, 10, 5, 0, 0, function(x, y) {
var stack = Composites.stack(200, 606 - 25.25 - 5 * 40, 10, 5, 0, 0, function(x, y) {
return Bodies.rectangle(x, y, 40, 40);
});

View file

@ -31,7 +31,7 @@ Example.stress = function() {
Runner.run(runner, engine);
// scene code
var stack = Composites.stack(90, 50, 18, 15, 0, 0, function(x, y) {
var stack = Composites.stack(90, 600 - 25 - 15 * 35, 18, 15, 0, 0, function(x, y) {
return Bodies.rectangle(x, y, 35, 35);
});

View file

@ -31,7 +31,7 @@ Example.stress2 = function() {
Runner.run(runner, engine);
// scene code
var stack = Composites.stack(100, 120, 25, 18, 0, 0, function(x, y) {
var stack = Composites.stack(100, 600 - 25 - 18 * 25, 25, 18, 0, 0, function(x, y) {
return Bodies.rectangle(x, y, 25, 25);
});

View file

@ -34,7 +34,7 @@ Example.wreckingBall = function() {
// add bodies
var rows = 10,
yy = 600 - 21 - 40 * rows;
yy = 600 - 25 - 40 * rows;
var stack = Composites.stack(400, yy, 5, rows, 0, 0, function(x, y) {
return Bodies.rectangle(x, y, 40, 40);