-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
SystemParam QueryRecursive for safe recursive iteration.
#13607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
QueryRecursive, a generalized version of propagate_transform .QueryRecursive for safe recursive iteration.
This reverts commit 60afdf7.
|
Aside from the API being IMO a bit rough & needing more design the issue with this is it's a stopgap that can be done via third party. Specifically: So the question then is what additional value would there be to providing this stopgap as a first party? Bare in mind this is already a kind of niche scenario simply due to the fact that hierarchy right now is very limited. |
I think this PR is very important since
I welcome suggestion to changes in the API. |
Objective
Recursive iterating through the hierarchy while keeping a reference to parent requires
unsafe, as seen inpropagate_transforminbevy_transform. This PR alleviates this issue by generalizing recursive iteration into a safe interface.Solution
Added
QueryRecursivethat contains 2 queries from 5 generic parameters.QueryDataSharedgets passed from parent to children as a reference during iteration.Additionally we support passing evaluation results from parent to children in
iter_mut_with.Example: transform pipeline (naive implementation)
Testing
Added some tests.
Changelog
Added
QueryRecursive.