pub struct Scene {
pub nodes: BTreeMap<NodeId, Node>,
pub roots: Vec<NodeId>,
/* private fields */
}Expand description
Flat node map. Roots have parent == None; roots keeps stable ordering.
Fields§
§nodes: BTreeMap<NodeId, Node>§roots: Vec<NodeId>Implementations§
Source§impl Scene
impl Scene
pub fn new() -> Self
pub fn alloc_node_id(&mut self) -> NodeId
Sourcepub fn insert(&mut self, parent: Option<NodeId>, node: Node) -> NodeId
pub fn insert(&mut self, parent: Option<NodeId>, node: Node) -> NodeId
Insert a node under parent (None = scene root). Returns the id.
pub fn get(&self, id: NodeId) -> Option<&Node>
pub fn get_mut(&mut self, id: NodeId) -> Option<&mut Node>
pub fn remove(&mut self, id: NodeId) -> Option<Node>
Sourcepub fn remove_subtree(&mut self, id: NodeId)
pub fn remove_subtree(&mut self, id: NodeId)
Remove a node and its whole subtree.
Sourcepub fn world_transform(&self, id: NodeId) -> Transform
pub fn world_transform(&self, id: NodeId) -> Transform
World transform = product of TRS from root down to this node.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scene
impl<'de> Deserialize<'de> for Scene
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Scene
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
impl UnwindSafe for Scene
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