Closed giusdp closed 3 months ago
Seems very good, thank you so much! :) I'll have a closer look tonight and merge + release if it's OK
Code seems to work, however CI does not like having the same public functions being defined twice :( (and I'm not sure why I had to manually trigger it)
Would it be possible to rename public functions in src/physics/rapier.rs
to insert_XXX_rapier_colliders
and public functions in src/physics/avian.rs
to insert_XXX_avian_colliders
?
We could then define functions insert_object_colliders
and insert_tile_colliders
in ./src/physics/mod.rs
which will call either backend based upon feature flags (simple pass-through functions).
This way, you won't have to rename everything in the other places.
Also, could you please add the new examples in examples/README.md
?
Thanks!
Code seems to work, however CI does not like having the same public functions being defined twice :( (and I'm not sure why I had to manually trigger it)
Would it be possible to rename public functions in
src/physics/rapier.rs
toinsert_XXX_rapier_colliders
and public functions insrc/physics/avian.rs
toinsert_XXX_avian_colliders
? We could then define functionsinsert_object_colliders
andinsert_tile_colliders
in./src/physics/mod.rs
which will call either backend based upon feature flags (simple pass-through functions). This way, you won't have to rename everything in the other places.Also, could you please add the new examples in
examples/README.md
?Thanks!
Working on it!
Clippy now was happy locally @adrien-bon
Seems good! I'll merge and do the release. Thank you very much! :)
Close #14
This PR adds
physics/avian.rs
as an alternative to rapier. Avian2D was added as another optional feature and all the#[cfg(feature = "rapier")]
were either updated to#[cfg(any(feature = "rapier", feature = "avian"))]
or the avian conditional was added right after. All the rapier examples were replicated with the avian version as well.In the properties/event.rs the function
spawn_rapier_collider
was generalized tospawn_collider
since now it can either be rapier or avian.