Open rparrett opened 3 years ago
Sorry for the super late reply. No it doesn't exist yet I have the start of the 2d version but never finished fully converting everything. I made bam3d for a personal game I was working so just got that working for what i specifically needed. Unfortunately I've been busy with work, other projects, and some real life stuff so I never got around to finishing the 2d version.
This is basically a port of the cgmath crate collision. To get the 2d working just need to remove the 3d shapes (Sphere, cuboid, etc) and change the vec3
s to vec2
. Its been awhile there was one more thing left to do but I forget exactly what it was haha.
If you need I can find the bam2d code I have finished and upload it to github, it's floating around my computer somewhere... haha. I also have an updated bam3d version i've been using for my personal game.
For something that just works I would recommend parry. It's built on nalgebra so it'll add some bloat to your glam project but the documentation is top notch and they're really responsive if you have any questions in discord
There is also circle2d which uses glam. It only supports circles and distance fields but depending on your game you may be able to get by just fine with circular hit boxes
Thanks! I appreciate the response.
I wouldn't turn down a head start on a 2d version, if it's easy enough to dig up.
I've looked into parry previously, and it looks great, but lacks documentation and seems difficult to use outside of rapier.
There's currently a big gap waiting to be filled for lightweight collision detection that cooperates well with the Bevy engine, which does all its math with glam, and I'm interested in seeing what integration might look like. (But I have also become rather busy lately, so who knows if that will actually happen.)
In case you have any other recommendations, I'm currently needing to collide a bunch of line segments and circles.
Does bam2d exist?
It sounds like just the thing I need (lightweight 2d collisions in the glam ecosystem).
https://github.com/dallasc/bam2d is a 404 and google/crates.io turned up nothing.