pub trait ExtractComponent: Component {
    type QueryData: ReadOnlyQueryData;
    type QueryFilter: QueryFilter;
    type Out: Bundle;

    // Required method
    fn extract_component(
        item: <Self::QueryData as WorldQuery>::Item<'_>
    ) -> Option<Self::Out>;
}
Expand description

Describes how a component gets extracted for rendering.

Therefore the component is transferred from the “app world” into the “render world” in the ExtractSchedule step.

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.

source

type Out: Bundle

The output from extraction.

Returning None based on the queried item can allow early optimization, for example if there is an enabled: bool field on Self, or by only accepting values within certain thresholds.

The output may be different from the queried component. This can be useful for example if only a subset of the fields are useful in the render world.

Out has a Bundle trait bound instead of a Component trait bound in order to allow use cases such as tuples of components as output.

Required Methods§

source

fn extract_component( item: <Self::QueryData as WorldQuery>::Item<'_> ) -> Option<Self::Out>

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ExtractComponent for DebandDither

source§

impl ExtractComponent for Tonemapping

source§

impl ExtractComponent for ShadowFilteringMethod

source§

impl ExtractComponent for BloomSettings

§

type QueryData = (&'static BloomSettings, &'static Camera)

§

type QueryFilter = ()

§

type Out = (BloomSettings, BloomUniforms)

source§

impl ExtractComponent for ContrastAdaptiveSharpeningSettings

source§

impl ExtractComponent for Fxaa
where Fxaa: Clone,

§

type QueryData = &'static Fxaa

§

type QueryFilter = With<Camera>

§

type Out = Fxaa

source§

impl ExtractComponent for Camera2d
where Camera2d: Clone,

source§

impl ExtractComponent for Camera3d
where Camera3d: Clone,

source§

impl ExtractComponent for Skybox

§

type QueryData = (&'static Skybox, Option<&'static Exposure>)

§

type QueryFilter = ()

§

type Out = (Skybox, SkyboxUniforms)

source§

impl ExtractComponent for PbrDeferredLightingDepthId

source§

impl ExtractComponent for FogSettings

source§

impl ExtractComponent for ScreenSpaceAmbientOcclusionSettings

source§

impl ExtractComponent for CameraMainTextureUsages

source§

impl<T> ExtractComponent for Handle<T>
where T: Asset,

§

type QueryData = &'static Handle<T>

§

type QueryFilter = ()

§

type Out = Handle<T>