0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-26 13:49:01 -05:00

fixed options pass through on Bodies.fromVertices

This commit is contained in:
liabru 2015-02-01 23:14:59 +00:00
parent 0b8efa5c40
commit eb29367459
2 changed files with 14 additions and 4 deletions

View file

@ -144,10 +144,20 @@
Demo.reset(); 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('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); World.add(_world, concave);
var renderOptions = _engine.render.options; var renderOptions = _engine.render.options;

View file

@ -234,10 +234,10 @@ var Bodies = {};
// create a compound part // create a compound part
parts.push( parts.push(
Body.create({ Body.create(Common.extend({
position: Vertices.centre(chunkVertices), position: Vertices.centre(chunkVertices),
vertices: chunkVertices vertices: chunkVertices
}) }, options))
); );
} }