Make Collider
optional, allowing usage without Parry or Nalgebra
#327
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
#311 added support for custom collider backends. However, the default
Collider
still remains, which requires the Parry and Nalgebra dependencies which are unnecessary if your collision backend doesn't use them.Collider
and Parry should be optional.Solution
Add three feature flags:
default-collider
,parry-f32
, andparry-f64
.parry-f32
is a default feature that also enablesdefault-collider
.The Parry features are unfortunately necessary, because Parry is split into separate crates for f32 and f64, and we can't reuse the
f32
andf64
feature flags, because then the dependencies wouldn't be optional.Not having the
default-collider
feature disablesCollider
, the default collision backend using it, theSpatialQueryPipeline
, theSpatialQuery
system parameter, andShapeCaster
. TheRayCaster
is still available for now, but it doesn't actually raycast unless users implement the functionality themselves.Changelog
default-collider
,parry-f32
, andparry-f64
ColliderAabb
no longer uses Parry's AABB, and it has new methodsMigration Guide
parry-f32
orparry-f64
feature, unless you have a custom collision backend