Skip to content

Commit 9d3755a

Browse files
committed
fix issue of undefined body.parts in constructor
1 parent d082b3a commit 9d3755a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/body/Body.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ var Body = {};
110110
* @param {} options
111111
*/
112112
var _initProperties = function(body, options) {
113-
// init required properties
113+
// init required properties (order is important)
114114
Body.set(body, {
115115
bounds: body.bounds || Bounds.create(body.vertices),
116116
positionPrev: body.positionPrev || Vector.clone(body.position),
117117
anglePrev: body.anglePrev || body.angle,
118118
vertices: body.vertices,
119+
parts: body.parts || [body],
119120
isStatic: body.isStatic,
120121
isSleeping: body.isSleeping,
121-
parent: body.parent || body,
122-
parts: body.parts
122+
parent: body.parent || body
123123
});
124124

125125
Vertices.rotate(body.vertices, body.angle, body.position);

0 commit comments

Comments
 (0)