0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

fix issue of undefined body.parts in constructor

This commit is contained in:
liabru 2015-03-03 23:43:24 +00:00
parent d082b3adcc
commit 9d3755ab6e

View file

@ -110,16 +110,16 @@ var Body = {};
* @param {} options
*/
var _initProperties = function(body, options) {
// init required properties
// init required properties (order is important)
Body.set(body, {
bounds: body.bounds || Bounds.create(body.vertices),
positionPrev: body.positionPrev || Vector.clone(body.position),
anglePrev: body.anglePrev || body.angle,
vertices: body.vertices,
parts: body.parts || [body],
isStatic: body.isStatic,
isSleeping: body.isSleeping,
parent: body.parent || body,
parts: body.parts
parent: body.parent || body
});
Vertices.rotate(body.vertices, body.angle, body.position);