-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Component Bundle Queries #2252
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be mergedThis issue or PR is particularly complex, and needs an approved design doc before it can be merged
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be mergedThis 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?
Reduce the verbosity of queries by using bundles, which are already used for this purpose during entity archetype construction.
What solution would you like?
The ability to add a struct that derives
Bundleto a query, and have it return with its fields accessible as components. E.g.:What alternative(s) have you considered?
Most of this can already be achieved with some verbosity, as shown in the dog example above. However, it would also allow us to split apart common components like
Transforminto their parts with field level change detection, without losing the ergonomics of theTransformtype.Additional context
Similar to #786