Add a Removed query filter #2148
Labels
A-ECS
Entities, components, systems, and events
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
S-Needs-Design-Doc
This issue or PR is particularly complex, and needs an approved design doc before it can be merged
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: