pub struct SceneGraph3D { /* private fields */ }Expand description
Flat depth-sorted 3D scene graph with zero-allocation dirty-bitset world-matrix propagation and Blender Collections.
Implementations§
Source§impl SceneGraph3D
Hierarchy insertion, dirty bitset management, and zero-allocation propagation for SceneGraph3D.
impl SceneGraph3D
Hierarchy insertion, dirty bitset management, and zero-allocation propagation for SceneGraph3D.
Sourcepub fn add_node(&mut self, node: SceneNode3D) -> u32
pub fn add_node(&mut self, node: SceneNode3D) -> u32
Sourcepub fn attach_morph_weights(&mut self, node_id: u32, weights: &[f32])
pub fn attach_morph_weights(&mut self, node_id: u32, weights: &[f32])
Appends initial shape-key morph weights for node_id and records their slice range.
§Arguments
&Self- Mutable scene graph.u32- Target node index.&[f32]- Initial morph target weights.
Sourcepub fn set_local_trs(
&mut self,
node_id: u32,
translation: Vec3,
rotation: Quat,
scale: Vec3,
)
pub fn set_local_trs( &mut self, node_id: u32, translation: Vec3, rotation: Quat, scale: Vec3, )
Updates a node’s local TRS transform and marks its subtree dirty without allocating.
§Arguments
&Self- Mutable scene graph.u32- Target node index.Vec3- Local translation.Quat- Local rotation quaternion.Vec3- Local non-uniform scale.
Sourcepub fn set_local_matrix(&mut self, node_id: u32, matrix: Mat4)
pub fn set_local_matrix(&mut self, node_id: u32, matrix: Mat4)
Decomposes a local 4x4 matrix into TRS and applies it to node_id.
§Arguments
&Self- Mutable scene graph.u32- Target node index.Mat4- Local 4x4 transformation matrix.
Sourcepub fn mark_dirty(&mut self, node_id: u32)
pub fn mark_dirty(&mut self, node_id: u32)
Sets the dirty bit for node_id in O(1) with zero heap allocations.
§Arguments
&Self- Mutable scene graph.u32- Target node index.
Sourcepub fn morph_weights_for_node(&self, node_id: u32) -> &[f32]
pub fn morph_weights_for_node(&self, node_id: u32) -> &[f32]
Sourcepub fn update_morph_weights(&mut self, node_id: u32, weights: &[f32])
pub fn update_morph_weights(&mut self, node_id: u32, weights: &[f32])
Overwrites morph weights for node_id in place with zero heap allocations.
§Arguments
&Self- Mutable scene graph.u32- Target node index.&[f32]- New morph target weights.
Sourcepub fn ensure_topology_order(&mut self)
pub fn ensure_topology_order(&mut self)
Rebuilds the depth-sorted topological traversal list when nodes were inserted or reparented.
§Arguments
&Self- Mutable scene graph.
Sourcepub fn propagate_world_matrices(&mut self) -> usize
pub fn propagate_world_matrices(&mut self) -> usize
Source§impl SceneGraph3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl SceneGraph3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_nodes(&self) -> &Vec<SceneNode3D>
pub fn get_mut_nodes(&mut self) -> &mut Vec<SceneNode3D>
pub fn set_nodes(&mut self, val: Vec<SceneNode3D>) -> &mut Self
pub fn get_topo_order(&self) -> &Vec<u32>
pub fn get_mut_topo_order(&mut self) -> &mut Vec<u32>
pub fn set_topo_order(&mut self, val: Vec<u32>) -> &mut Self
pub fn get_dirty_words(&self) -> &Vec<u64>
pub fn get_mut_dirty_words(&mut self) -> &mut Vec<u64>
pub fn set_dirty_words(&mut self, val: Vec<u64>) -> &mut Self
pub fn get_morph_weights(&self) -> &Vec<f32>
pub fn get_mut_morph_weights(&mut self) -> &mut Vec<f32>
pub fn set_morph_weights(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_collections(&self) -> &CollectionRegistry3D
pub fn get_mut_collections(&mut self) -> &mut CollectionRegistry3D
pub fn set_collections(&mut self, val: CollectionRegistry3D) -> &mut Self
pub fn get_topology_dirty(&self) -> bool
pub fn get_mut_topology_dirty(&mut self) -> &mut bool
pub fn set_topology_dirty(&mut self, val: bool) -> &mut Self
pub fn get_revision(&self) -> u64
pub fn get_mut_revision(&mut self) -> &mut u64
pub fn set_revision(&mut self, val: u64) -> &mut Self
Trait Implementations§
Source§impl Clone for SceneGraph3D
impl Clone for SceneGraph3D
Source§impl Debug for SceneGraph3D
impl Debug for SceneGraph3D
Source§impl Default for SceneGraph3D
Default empty hierarchy for SceneGraph3D.
impl Default for SceneGraph3D
Default empty hierarchy for SceneGraph3D.