-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add a Removed query filter #2148
Comments
Could this be implemented prior to subworlds just as a filter, in such a way that |
Yep, this should be totally feasible before subworlds. I think that only allowing it in the filter position for now is just fine; we're always going to want that ability. Once we can access the removed data I think that the correct approach is to do something like |
From my draft of the relevant section of the book:
|
What problem does this solve or what need does it fill?
The existing RemovedComponent API is somewhat unclear and cumbersome. It also commonly requires a manual query filtering step to make use of, which is both slow and full of boilerplate.
What solution would you like?
I want to be able to add
Removed<T>
to my queries as a filter to only include entities that have had the component removed since the system last ran using reliable change detection.What alternative(s) have you considered?
We could also store the values of the removed components, but that won't be feasible with reliable change detection.
Additional context
With the addition of subworlds / multiple worlds (bevyengine/rfcs#16), we could move removed components to a parallel purgatory subworld for two frames using a double-buffer pattern, allowing us the ability to access removed data.
#13928 offers another way to remove
RemovedComponents
, which should be pursued. It may still be worth having aRemoved
filter after that, but its value is much less clear.The text was updated successfully, but these errors were encountered: