0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-03-14 00:38:41 -04:00
This commit is contained in:
Zhijie Xia 2024-07-23 16:54:32 +02:00 committed by GitHub
commit a3ffcfef59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,6 +308,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));