Skip to main content

SceneNode

Trait SceneNode 

Source
pub trait SceneNode: Send {
Show 23 methods // Required methods fn get_world_transforms(&self) -> Vec<Instance>; fn get_world_transform(&self, idx: usize) -> Option<&Instance>; fn get_local_transform(&self, idx: usize) -> Option<&Instance>; fn draw<'a, 'pass>( &self, camera_bind_group_layout: &'a BindGroup, light_bind_group: &'a BindGroup, render_pass: &'pass mut RenderPass<'a>, ) where 'a: 'pass; fn to_clickable(&self, device: &Device, id: PickId) -> Box<dyn SceneNode>; fn get_children(&self) -> &Vec<Box<dyn SceneNode>>; fn add_child(&mut self, child: Box<dyn SceneNode>) -> usize; fn remove_child(&mut self, idx: usize) -> Box<dyn SceneNode>; fn set_local_transform(&mut self, idx: usize, instance: Instance); fn set_local_transform_all( &mut self, mutation: &mut dyn FnMut(&mut Instance), ); fn get_children_mut(&mut self) -> &mut Vec<Box<dyn SceneNode>>; fn write_to_buffers(&mut self, queue: &Queue, device: &Device); fn update_world_transforms( &mut self, range: Range<usize>, parents_world_transform: &Vec<Instance>, ); fn update_world_transform_all(&mut self); fn add_instance(&mut self, instance: Instance) -> usize; fn add_instances(&mut self, instances: Vec<Instance>) -> usize; fn set_instances(&mut self, instances: Vec<Instance>) -> usize; fn remove_instance(&mut self, idx: usize) -> (Instance, Instance); fn duplicate_instance(&mut self, i: usize) -> usize; fn get_animation(&self) -> &Vec<ModelAnimation>; fn get_render(&self) -> Vec<Instanced<'_>>; fn render_inverted(&mut self); // Provided method fn get_render_dir(&self) -> FrontFace { ... }
}

Required Methods§

Source

fn get_world_transforms(&self) -> Vec<Instance>

Source

fn get_world_transform(&self, idx: usize) -> Option<&Instance>

Source

fn get_local_transform(&self, idx: usize) -> Option<&Instance>

Source

fn draw<'a, 'pass>( &self, camera_bind_group_layout: &'a BindGroup, light_bind_group: &'a BindGroup, render_pass: &'pass mut RenderPass<'a>, )
where 'a: 'pass,

Source

fn to_clickable(&self, device: &Device, id: PickId) -> Box<dyn SceneNode>

Source

fn get_children(&self) -> &Vec<Box<dyn SceneNode>>

Source

fn add_child(&mut self, child: Box<dyn SceneNode>) -> usize

Adds a child node to the tree and returns the childs index

Source

fn remove_child(&mut self, idx: usize) -> Box<dyn SceneNode>

Source

fn set_local_transform(&mut self, idx: usize, instance: Instance)

Source

fn set_local_transform_all(&mut self, mutation: &mut dyn FnMut(&mut Instance))

Source

fn get_children_mut(&mut self) -> &mut Vec<Box<dyn SceneNode>>

Source

fn write_to_buffers(&mut self, queue: &Queue, device: &Device)

Source

fn update_world_transforms( &mut self, range: Range<usize>, parents_world_transform: &Vec<Instance>, )

Multiple instances of a parent can be passed down to multiple instances of multiple children. The argument parents_world_transform with a matching range size provides control over which instances are transformed.

Source

fn update_world_transform_all(&mut self)

Source

fn add_instance(&mut self, instance: Instance) -> usize

Adds an instance to the scene node (and its children) and returns the index of the added instance

Source

fn add_instances(&mut self, instances: Vec<Instance>) -> usize

Adds multiple instance to the scene node (and its children) and returns index of the last instance

Source

fn set_instances(&mut self, instances: Vec<Instance>) -> usize

Source

fn remove_instance(&mut self, idx: usize) -> (Instance, Instance)

Source

fn duplicate_instance(&mut self, i: usize) -> usize

Source

fn get_animation(&self) -> &Vec<ModelAnimation>

Source

fn get_render(&self) -> Vec<Instanced<'_>>

Source

fn render_inverted(&mut self)

Provided Methods§

Implementations§

Source§

impl dyn SceneNode

Source

pub fn transform_local(&mut self, instance: Instance) -> Instance

Source

pub fn transform_locals(&mut self, instances: Vec<Instance>) -> Vec<Instance>

Trait Implementations§

Source§

impl<'a, 'pass> From<&'a dyn SceneNode> for Render<'a, 'pass>

Source§

fn from(sn: &'a dyn SceneNode) -> Self

Converts to this type from the input type.
Source§

impl<'a, 'pass> From<&'a (dyn SceneNode + Send)> for Render<'a, 'pass>

Source§

fn from(sn: &'a (dyn SceneNode + Send)) -> Self

Converts to this type from the input type.

Implementors§