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§
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>>
Sourcefn add_child(&mut self, child: Box<dyn SceneNode>) -> usize
fn add_child(&mut self, child: Box<dyn SceneNode>) -> usize
Adds a child node to the tree and returns the childs index
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)
Sourcefn update_world_transforms(
&mut self,
range: Range<usize>,
parents_world_transform: &Vec<Instance>,
)
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.
fn update_world_transform_all(&mut self)
Sourcefn add_instance(&mut self, instance: Instance) -> usize
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
Sourcefn add_instances(&mut self, instances: Vec<Instance>) -> usize
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