quinton-ashley / p5play

JavaScript game engine that uses q5.js/p5.js for graphics and Box2D for physics.
https://p5play.org
GNU Affero General Public License v3.0
667 stars 184 forks source link

Create colliders based on images #284

Open quinton-ashley opened 11 months ago

quinton-ashley commented 11 months ago

Currently p5play can make a box collider based on the dimensions of an image.

But the idea of this feature would be to make colliders based on the outline of an object in an image with a transparent background. Users could have control over the maximum number of vertices the resulting collider polygons would have in total.

Typically, this isn't a good thing to do for performance reasons, and box and circle colliders work just fine in many cases, but this feature could be useful in specific cases.