pub struct Scene { /* private fields */ }Implementations§
Source§impl Scene
impl Scene
pub fn new() -> Scene
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn node(&self, id: NodeId) -> Result<&Node, SceneError>
pub fn nodes(&self) -> impl Iterator<Item = (NodeId, &Node)>
pub fn create( &mut self, name: impl Into<String>, local: Transform, parent: Option<NodeId>, ) -> Result<NodeId, SceneError>
pub fn set_local( &mut self, id: NodeId, local: Transform, ) -> Result<(), SceneError>
Sourcepub fn set_parent(
&mut self,
id: NodeId,
parent: Option<NodeId>,
) -> Result<(), SceneError>
pub fn set_parent( &mut self, id: NodeId, parent: Option<NodeId>, ) -> Result<(), SceneError>
Reparent while retaining local TRS. Cycles and invalid handles are rejected before any links change. World-space position may change.
pub fn world_matrix(&self, id: NodeId) -> Result<[f32; 16], SceneError>
pub fn remove_subtree(&mut self, root: NodeId) -> Result<usize, SceneError>
Sourcepub fn prefab(&self, root: NodeId) -> Result<Prefab, SceneError>
pub fn prefab(&self, root: NodeId) -> Result<Prefab, SceneError>
Captures local transforms and hierarchy; external parent links are omitted.
pub fn instantiate( &mut self, prefab: &Prefab, parent: Option<NodeId>, ) -> Result<NodeId, SceneError>
pub fn clone_subtree( &mut self, root: NodeId, parent: Option<NodeId>, ) -> Result<NodeId, SceneError>
Sourcepub fn encode(&self) -> Result<Vec<u8>, SceneError>
pub fn encode(&self) -> Result<Vec<u8>, SceneError>
GSC1 format: magic, u16 version, u32 count; each node has u32 parent (MAX=root), u16 UTF-8 name length, name bytes, and 10 little-endian f32 TRS values. Handles are remapped; serialized data never trusts slot generations.
pub fn decode(bytes: &[u8]) -> Result<Scene, SceneError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin 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