diff --git a/src/factory/Bodies.js b/src/factory/Bodies.js index c55e6150..25b1c23e 100644 --- a/src/factory/Bodies.js +++ b/src/factory/Bodies.js @@ -303,6 +303,21 @@ var Vector = require('../geometry/Vector'); } } + + if(parts.length==0) + { + for (v = 0; v < vertexSets.length; v += 1) { + vertices = vertexSets[v]; + + vertices = Vertices.hull(vertices); + + parts.push({ + position: { x: x, y: y }, + vertices: vertices + }); + } + } + // create body parts for (i = 0; i < parts.length; i++) { parts[i] = Body.create(Common.extend(parts[i], options));