schteppe / p2.js

JavaScript 2D physics library
Other
2.64k stars 330 forks source link

Polygon with holes in it? #301

Closed schoening closed 7 years ago

schoening commented 7 years ago

Is this possible out of the box, or do I need to glue two+ polygons together?

schteppe commented 7 years ago

You should be able to use a single polygon. p2 will automatically convert to convex sub-shapes internally.

If you don't want p2 to do the conversion (for example, if you want to save some CPU usage) you should use many convex shapes instead, using the Convex class.

schoening commented 7 years ago

Ohh damn! P2 just keeps getting better and better!