New pub methods to facilitate external query implementations #862
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
SpatialQueryPipelineconstituents needed to implement methods likecast_shape.Solution
dispatcher_ref() { self.dispatcher.as_ref() }andentity(index) { self.proxies[index].entity }implemented rather than just making the fieldspubto ensure downstreams can only use the values, not mess with them in any ways that could compromise correctness-> impl TypedCompositeShape, so that the return types don't have to be madepub) versions of the existingas_composite_shape*methods, renaming the existing ones by adding_internal. I think it would be possible to replace the existing versions with these new ones altogether, but I worried that might prove unnecessarily restrictive in future. Alternatively could just make the existing methods and their return types public.Changelog
Added
SpatialQueryPipelinethat allow downstream crates to implement additional spatial queriesas_composite_shape/as_composite_shape_with_predicatereturn composite shapes representing the Avian world, usable with parry's bvh/spatial query machinerydispatcher_refreturns a reference to the QueryDispatcher used by the pipelineentity(idx)fetches theEntityreferred to by the given index in the pipeline's BVH. Useful for interpreting the results of parry queries, which refer to colliders by their index within the BVH