New pub methods to facilitate external query implementations#862
Merged
Jondolf merged 1 commit intoavianphysics:mainfrom Oct 12, 2025
Merged
Conversation
Jondolf
approved these changes
Oct 12, 2025
Member
Jondolf
left a comment
There was a problem hiding this comment.
Thanks! These names look fine, and I'm happy to expose the methods to unblock custom query use cases. The details will likely change with upcoming spatial query reworks (ex: #810), but these are relatively advanced APIs anyway, so I'm not too concerned about breaking users there
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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