Trait ExtractComponent

Source
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 will remove the component from the entity in the render world. This can be used, for example, to conditionally extract camera settings in order to disable a rendering feature on the basis of those settings, without removing the component from the entity in the main world.

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”.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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 Msaa
where Msaa: Clone,

Source§

impl ExtractComponent for Readback
where Readback: Clone,

Source§

impl ExtractComponent for AutoExposure

Source§

impl ExtractComponent for Bloom

Source§

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

Source§

type QueryFilter = ()

Source§

type Out = (Bloom, BloomUniforms)

Source§

impl ExtractComponent for ContrastAdaptiveSharpening

Source§

impl ExtractComponent for Fxaa
where Fxaa: Clone,

Source§

impl ExtractComponent for MotionBlur

Source§

impl ExtractComponent for OrderIndependentTransparencySettings

Source§

impl ExtractComponent for ChromaticAberration

Source§

impl ExtractComponent for Smaa
where Smaa: Clone,

Source§

impl ExtractComponent for Skybox

Source§

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

Source§

type QueryFilter = ()

Source§

type Out = (Skybox, SkyboxUniforms)

Source§

impl ExtractComponent for PbrDeferredLightingDepthId

Source§

impl ExtractComponent for ScreenSpaceAmbientOcclusion

Source§

impl ExtractComponent for ScreenSpaceReflections

Source§

impl ExtractComponent for Camera2d
where Camera2d: Clone,

Source§

impl ExtractComponent for Camera3d
where Camera3d: Clone,

Source§

impl ExtractComponent for DistanceFog

Source§

impl ExtractComponent for CameraMainTextureUsages