Skip to content

Commit

Permalink
fixed options pass through on Bodies.fromVertices
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Feb 1, 2015
1 parent 0b8efa5 commit eb29367
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions demo/js/Demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,20 @@

Demo.reset();

var vertices = Matter.Vertices.fromPath('354 89,336 118,310 145,302 227,322 271,375 292,490 289,539 271,540 233,549 133,526 100,552 36,601 63,633 122,628 227,594 304,505 340,426 340,327 330,265 294,246 242,246 181,256 133,283 81,346 44');
//var vertices = Matter.Vertices.fromPath('354 89,336 118,310 145,302 227,322 271,375 292,490 289,539 271,540 233,549 133,526 100,552 36,601 63,633 122,628 227,594 304,505 340,426 340,327 330,265 294,246 242,246 181,256 133,283 81,346 44');
//var vertices = Matter.Vertices.fromPath('164 171,232 233,213 302,273 241,342 305,316 231,364 170,309 188,281 117,240 182');
var vertices = Matter.Vertices.fromPath('272 83,266 237,459 236,452 65,526 62,536 297,195 296,203 84');
//var vertices = Matter.Vertices.fromPath('243 68,274 53,318 54,366 76,391 112,390 159,370 198,316 214,260 210,215 187,205 141,206 103,235 75');

var concave = Bodies.fromVertices(200, 200, vertices, {
restitution: 1,
friction: 0,
render: {
fillStyle: '#556270',
strokeStyle: '#556270'
}
});

var concave = Bodies.fromVertices(200, 200, vertices);
World.add(_world, concave);

var renderOptions = _engine.render.options;
Expand Down
4 changes: 2 additions & 2 deletions src/factory/Bodies.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ var Bodies = {};

// create a compound part
parts.push(
Body.create({
Body.create(Common.extend({
position: Vertices.centre(chunkVertices),
vertices: chunkVertices
})
}, options))
);
}

Expand Down

0 comments on commit eb29367

Please sign in to comment.