shnewto/bevy_collider_gen

bevy_xpbd collider gen?

Closed this issue ยท 2 comments

I've been noticing that there are plenty of other things (beyond rapier colliders ๐Ÿ˜„) that could be useful once we have what this crate does under the hood, i.e. provide the edges of a sprite / image. one of those things is colliders for other physics engines like bevy_xpbd.

My naming of this project / crate wasn't very forward thinking in that regard, but maybe if there's an opportunity to extend to things outside the world of simply rapier colliders, I can figure some renaming to be more appropriate for what this whole thing does ๐Ÿ˜…

The "rapier collider" bit of this crate maybe a misnomer anyway, it does do that, but it doesn't have to only do that. the implementation isn't specific to the rapier engine afaik. it was just a convenient (to me) library that gave me what I was wanting at the time (rapier colliders). I think we could provide the same thing using this crate's edge module and whatever library accepts a collection of points.

Another issue that I saw mentioned in the Bevy discord is that pixel perfect colliders may not always be ideal for large sprites, I'd be glad to hear about and try to support alternative collections of points, or maybe just a convenient / smart ways to filter the points after they're generated.

@Jondolf if any of my ramblings sound interesting to you, I'd be glad for your input!

I'm going to tag this issue as "help wanted" in case anyone feels inspired to tackle some of this, specifically xpbd support before I find some time to try and wrangle it myself.

it occurs to me that this crate already handles non-pixel perfect colliders so that doesn't need to come in here (unless someone can correct me). This crate will generate a number of colliders. convex polyline andpolyline are pixel perfect but convex hull and convex decomposition colliders are specifically for the case where you don't want / need something so exact.

we made it! we're not officially bevy_collider_gen and support both bevy_rapier2d and bevy_xpbd_2d