-
Notifications
You must be signed in to change notification settings - Fork 66
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
Deferred mutation queries #57
Conversation
"Defer mutation for better parallelism" is basically the purpose of |
I'm worried that the |
Yeah, we can bikeshed a better name if we decide to keep the mechanic.
Didn't consider fn foo(
mut commands: Commands,
bars: Query<(Entity, Cow<Bar>)>,
) {
for (entity, bar) in vars.iter() {
bar.0 = 0.0; // Copy happens
commands.entity(entity).insert(bar.to_owned()); // We (re)insert the component
}
} 2 problems with that would be:
|
Although bit non-obvious, using Commands seems like the way to go here. |
RENDERED
Queries that defer mutation of certain components.