Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support xpbd collider gen #11

Merged
merged 9 commits into from
Mar 2, 2024
Merged

support xpbd collider gen #11

merged 9 commits into from
Mar 2, 2024

Conversation

shnewto
Copy link
Owner

@shnewto shnewto commented Mar 1, 2024

context

  • this crate's main function is grabbing the points that make up the outline of a sprite from transparency and creating a physics engine collider. There's no reason that needs to be a rapier collider!
  • bevy_xpbd_2d is my first target for something beyond bevy_rapier2d
  • when this PR or equivalent work is merged to support more than just rapier2d colliders, I'll rename this repo and produce a new crate that can do both
  • more thoughts in bevy_xpbd collider gen? #7

approach

  • i'm wrestling a bit with how to gate these engines as features, i.e. one file that has #[cfg(feature(...))] or multiple files with some duplication and minimal need for #[cfg(feature(...))]. at the moment i'm favoring the latter, it feels like it'll be easier to work with a specific engine in mind if you don't have to worry about bumping something for another one. It will change the API but I think it'll be basically a new crate so I'm not so worried about breaking changes, just don't want it too feel to tangled to use this stuff, it's supposed to make life a bit easier.
  • atm i feel like just favoring support for xpbd over making all the right design decisions, anything left to be smoothed out can be in later releases

remaining questions/issues to resolve before merging

  • i haven't figured out how to do native heightfields in xpbd
  • i didn't spot convex polyline colliders in xpbd, are they known as something else or are they just not supported
  • i fumbled using polyline colliders in the xpbd example so switched to convex hull
  • re: the strikeouts above, I was able to use Collider::from(parry::SharedShape) to support convex polyline colliders and heightfields with xpbd_2d

@shnewto
Copy link
Owner Author

shnewto commented Mar 1, 2024

@CrockAgile if you're able to take a look at the cfg feature stuff i'm trying to work out, I'd be glad! 😄 🙏

@shnewto
Copy link
Owner Author

shnewto commented Mar 1, 2024

@Jondolf if you have any opinions on any of this goes down, i'd be glad to hear. would also be glad for pointers on using xpbd heightfeilds 😅

@shnewto shnewto marked this pull request as ready for review March 2, 2024 00:35
@shnewto
Copy link
Owner Author

shnewto commented Mar 2, 2024

okay all, I'm going to pull the trigger. I'll make some help wanted issues for helping me make the examples a little more engine-centric once things have been renamed and published

@shnewto shnewto merged commit 4525620 into main Mar 2, 2024
7 checks passed
@shnewto shnewto deleted the xpbd-collider-gen branch March 2, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant