Trait bevy_render::extract_instances::ExtractInstance

source ·
pub trait ExtractInstance: Send + Sync + Sized + 'static {
    type QueryData: ReadOnlyQueryData;
    type QueryFilter: QueryFilter;

    // Required method
    fn extract(item: QueryItem<'_, Self::QueryData>) -> Option<Self>;
}
Expand description

Describes how to extract data needed for rendering from a component or components.

Before rendering, any applicable components will be transferred from the main world to the render world in the ExtractSchedule step.

This is essentially the same as ExtractComponent, but higher-performance because it avoids the ECS overhead.

Required Associated Types§

source

type QueryData: ReadOnlyQueryData

ECS ReadOnlyQueryData to fetch the components to extract.

source

type QueryFilter: QueryFilter

Filters the entities with additional constraints.

Required Methods§

source

fn extract(item: QueryItem<'_, Self::QueryData>) -> Option<Self>

Defines how the component is transferred into the “render world”.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A> ExtractInstance for AssetId<A>
where A: Asset,

§

type QueryData = &'static Handle<A>

§

type QueryFilter = ()

source§

fn extract(item: QueryItem<'_, Self::QueryData>) -> Option<Self>

Implementors§