Expand description
This crate provides a way to extract component information from an app’s main world into a sub world.
The easiest way to set up extract is to add the ExtractPlugin for your AppLabel.
Then derive ExtractComponent or ExtractResource - ensure that you specify the extract_app attribute.
#[derive(Component, Clone, Debug, ExtractComponent)]
#[extract_app(SomeApp)]
struct SomeComponent;This adds SyncComponent to first sync the entities from the main world to the sub world.
And then sync the component data from the main entity to the sub entity.
More complex use cases may want to manually implement the ExtractComponent or ExtractResource traits directly.
For higher performance needs use the ExtractInstance trait.
The sub app can access the main world in the ExtractSchedule.
Adding a system with a query wrapped in Extract and it will run against the main app world.
Modules§
- extract_
component - extract_
instances - Convenience logic for turning components from the main world into extracted instances in the sub world.
- extract_
param - extract_
plugin - extract_
resource - sync_
component - sync_
world
Structs§
- Extract
- A helper for accessing
MainWorldcontent using a system parameter. - Extract
Plugin - Plugin that sets up the sub app for the
AppLabeland handles extracting data from the main world to the sub world. - Extract
Schedule - Schedule in which data from the main world is ‘extracted’ into the sub world.
- Main
Entity - Component added on the sub world entities to keep track of the corresponding main world entity.
- Main
World - The simulation
Worldof the application, stored as a resource. - SubEntity
- Component added on the main world entities that are synced to the Sub World in order to keep track of the corresponding sub world entity.
- Sync
ToSub World - Marker component that indicates that its entity needs to be synchronized to the sub world.
- Sync
World Plugin - A plugin that synchronizes entities with
SyncToSubWorldbetween the main world and the sub world. - Temporary
Entity - Marker component that indicates that its entity needs to be despawned at the end of the frame.
Functions§
- extract
- Executes the
ExtractSchedulestep of the processor. This updates the sub world with the extracted ECS data of the current frame.
Type Aliases§
- Main
Entity Hash Map - A
HashMappre-configured to useEntityHashhashing with aMainEntity. - Main
Entity Hash Set - A
HashSetpre-configured to useEntityHashhashing with aMainEntity.