Added user-implementable traits for collision/proximity pair filtering. #44
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.
Fix #3
Fix #15
This PR adds two traits
CollisionPairFilter
andProximityPairFilter
that allows user-defined logic for determining if two colliders/sensors are allowed to interact, as discussed in #3If these filters are set by the user (i.e. passed to the
PhysicsPipeline::step
method), then they replace the predefined filtering logic which consists of preventing contact computation between two non-dynamic bodies (the collision-groups on the other hands are still taken into account). That way, it is possible for the user to enable contacts and proximity between two non-dynamic bodies to be computed, as suggested in #15Finally, the
CollisionPairFilter
returns aSolverFlags
bitmask that will be used by the constraints solver to handle the contact manifolds for this collision pair. Currently, only one bit is implemented:SolverFlags::COMPUTE_IMPULSES
. If this bit is set, then the constraints solver will compute impulses for the contact manifolds generated by this contact pair. If this bit is not set, these contact manifolds will be ignored by the constraints solver.