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

Add support for bevy_xpbd #22

Merged
merged 20 commits into from
Nov 12, 2023
Merged

Add support for bevy_xpbd #22

merged 20 commits into from
Nov 12, 2023

Conversation

Jondolf
Copy link
Contributor

@Jondolf Jondolf commented Nov 10, 2023

Depends on #21; merge that first.

This PR adds support for bevy_xpbd as an alternative physics backend.

Changes

  • Added xpbd_collisions feature
  • Added rapier and xpbd sub-modules for collisions
  • Added xpbd_collision example; a clone of rapier_example, but modified for bevy_xpbd
  • Updated README.md and src/lib.rs to have separate sections for bevy_rapier and bevy_xpbd. If you'd like it to be changed more, let me know :)

@ManevilleF
Copy link
Owner

Thanks for your contribution, should I merge #21 first ? And then you'll rebase?

use bevy_xpbd_3d::prelude::*;

fn get_collider(aabb: &Aabb, collider: &ClothCollider) -> Collider {
let extents = aabb.half_extents * 2.0 + collider.offset;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the * 2.0 needed? We don't do that in rapier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collider::cuboid currently takes full extents to match Bevy's shape APIs better

@Jondolf
Copy link
Contributor Author

Jondolf commented Nov 10, 2023

Yeah, you can merge that one first. I'll fix the format warning here and add these changes to the changelog as well, and then rebase

@ManevilleF ManevilleF merged commit c94e650 into ManevilleF:main Nov 12, 2023
7 checks passed
@ManevilleF
Copy link
Owner

Btw to synchronize the README and lib.rs I use cargo-sync-readme

@Jondolf Jondolf deleted the bevy_xpbd branch November 12, 2023 16:28
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.

2 participants