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:
parent
d082b3adcc
commit
9d3755ab6e
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue