re_viewer_context

Trait ViewContextSystem

Source
pub trait ViewContextSystem: Send + Sync {
    // Required methods
    fn compatible_component_sets(&self) -> Vec<ComponentNameSet>;
    fn execute(&mut self, ctx: &ViewContext<'_>, query: &ViewQuery<'_>);
    fn as_any(&self) -> &dyn Any;
}
Expand description

View context that can be used by view parts and ui methods to retrieve information about the scene as a whole.

Is always populated before view part systems.

Required Methods§

Source

fn compatible_component_sets(&self) -> Vec<ComponentNameSet>

Returns all the component sets that the system is compatible with.

If an entity path satisfies any of these sets, then the system will automatically run for that entity path.

Return an empty vec to specify that the system should never run automatically for any specific entities. It may still run once per frame as part of the global context if it has been registered to do so, see crate::SpaceViewSystemRegistrator.

Source

fn execute(&mut self, ctx: &ViewContext<'_>, query: &ViewQuery<'_>)

Queries the chunk store and performs data conversions to make it ready for consumption by scene elements.

Source

fn as_any(&self) -> &dyn Any

Converts itself to a reference of std::any::Any, which enables downcasting to concrete types.

Implementors§