Skip to content

Commit

Permalink
fix issue of undefined body.parts in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Mar 3, 2015
1 parent d082b3a commit 9d3755a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/body/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9d3755a

Please sign in to comment.