bevy_collider_gen icon indicating copy to clipboard operation
bevy_collider_gen copied to clipboard

bevy_ecs_tilemap generation?

Open johanhelsing opened this issue 2 years ago • 2 comments

This looks really interesting. Would it be within the scope of the project to generate colliders from bevy_ecs_tilemap tilemaps? Could perhaps be added behind a feature flag?

johanhelsing avatar Jan 08 '23 12:01 johanhelsing

@johanhelsing I really like the idea that this crate can eventually support generating colliders from a number of starting points. I was imagining my next target might be meshes in GLTF files but I'm happy to dig into how generate colliders for tilemaps instead. I'd probably need to tap you for some testing once something's preliminarily in place though because I don't have much experience using tilemaps myself.

alternatively I'd welcome for a PR with this feature if you feel up for making one!

shnewto avatar Jan 08 '23 20:01 shnewto

@johanhelsing i'm working on a game which uses tiled map editor for tilemaps making and bevy_ecs_tilemap for loading using this helper and i modified it using the image crate to slice tilsets and then generating collider here's the code if you wanna take a look I use the images transparency ratios to know if it's some grass or a full block and determine if a collider is needed or not

here's what it looks like image

and for some reason my slopes aren't generated correctly so I might open an issue

Adrien5902 avatar Feb 09 '24 17:02 Adrien5902