pub struct RenderableSystem { /* private fields */ }Expand description
System that registers/updates renderables in the VisualWorld.
Contract / intent:
- A
RenderableComponentis expected to be a descendant of aTransformComponent. (In practice we attach renderables directly under a transform.) - Each
RenderableComponentcorresponds to exactly oneVisualWorldinstance. - The world-space model matrix for that instance is computed by walking up the component
tree and multiplying all ancestor
TransformComponentmodel matrices.
Implementations§
Source§impl RenderableSystem
impl RenderableSystem
pub fn register_color( &mut self, world: &mut World, _visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_opacity( &mut self, world: &mut World, _visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_transparent_cutout( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_light_quantization( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_emissive( &mut self, world: &mut World, _visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_uv( &mut self, world: &mut World, _visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_background_color( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
pub fn register_renderer_settings( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
Sourcepub fn register_normal_vis(&mut self, world: &World, component: ComponentId)
pub fn register_normal_vis(&mut self, world: &World, component: ComponentId)
Register a NormalVisualisationComponent for deferred spawning.
Called from the RegisterNormalVis intent handler during tick (where World is
available but RenderAssets is not). Walks up to the nearest parent
RenderableComponent, records its base_mesh handle, and queues the spawn for
flush_pending where mesh vertex data can be read.
Sourcepub fn register_renderable(
&mut self,
world: &mut World,
visuals: &mut VisualWorld,
component: ComponentId,
)
pub fn register_renderable( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
Register a renderable component with this system.
This is also where we ensure a VisualWorld instance exists for it.
pub fn remove_renderable( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
Sourcepub fn register_renderable_from_world(
&mut self,
world: &mut World,
visuals: &mut VisualWorld,
component: ComponentId,
)
pub fn register_renderable_from_world( &mut self, world: &mut World, visuals: &mut VisualWorld, component: ComponentId, )
Register a renderable by walking the component graph in World.
Sourcepub fn flush_pending(
&mut self,
world: &mut World,
visuals: &mut VisualWorld,
render_assets: &mut RenderAssets,
uploader: &mut dyn MeshUploader,
queue: &mut CommandQueue,
) -> bool
pub fn flush_pending( &mut self, world: &mut World, visuals: &mut VisualWorld, render_assets: &mut RenderAssets, uploader: &mut dyn MeshUploader, queue: &mut CommandQueue, ) -> bool
Flush any pending renderables by uploading required meshes and inserting only
GPU-ready instances into VisualWorld.
Trait Implementations§
Source§impl Debug for RenderableSystem
impl Debug for RenderableSystem
Source§impl Default for RenderableSystem
impl Default for RenderableSystem
Source§fn default() -> RenderableSystem
fn default() -> RenderableSystem
Returns the “default value” for a type. Read more
Source§impl System for RenderableSystem
impl System for RenderableSystem
fn tick( &mut self, _world: &mut World, _visuals: &mut VisualWorld, _input: &InputState, _dt_sec: f32, )
Auto Trait Implementations§
impl Freeze for RenderableSystem
impl RefUnwindSafe for RenderableSystem
impl Send for RenderableSystem
impl Sync for RenderableSystem
impl Unpin for RenderableSystem
impl UnsafeUnpin for RenderableSystem
impl UnwindSafe for RenderableSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.