-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add an inverse to Changed
and Added
filters
#7265
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
Comments
Should we consider a generic |
Probably would just be a simple |
I took a stab at My implementation also had |
As a user-story, today I tried to do something like the following in order to filter out all the entities that had a component added in the same frame. Query<&T, Without<Added<T>>> I was somewhat surprised that this was not supported. Having set-like operations defined on Query could also be useful to solve similar problems instead with run-time compositions, i.e. fn system(
a: Query<Entity>
b: Query<Added<&T>
) {
// set difference; C is the set of all entities that satisfy A but
// with the entities that satisfy B removed
let c: Query<Entity> = a - b;
} |
This would be much clearer if It's not the complementary set of entities, but the implied |
Allows exclusive access based on
Changed
orAdded
component, similar toWith
andWithout
.See #7264 (comment)
This is very niche, but might help squeeze out some perfs.
What solution would you like?
Add a
NotChanged<T>
andNotAdded<T>
component that returns all entities that theirChanged
andAdded
counterparts do not return.Am I missing something? It seems possible to discriminate based on those filters. Though it would likely require modifying the
AccessSet
content.What alternative(s) have you considered?
I added a
changed: Query<(), Changed<Transform>>
parameter, and call!changed.contains(&entity)
.Additional context
The text was updated successfully, but these errors were encountered: