pub struct Root {
pub nodes: Vec<Node>,
pub meshes: Vec<Rc<Mesh>>,
pub textures: Vec<Rc<Texture>>,
pub materials: Vec<Rc<Material>>,
pub shaders: HashMap<ShaderFlags, Rc<PbrShader>>,
pub camera_nodes: Vec<usize>,
}
Fields§
§nodes: Vec<Node>
§meshes: Vec<Rc<Mesh>>
§textures: Vec<Rc<Texture>>
§materials: Vec<Rc<Material>>
§shaders: HashMap<ShaderFlags, Rc<PbrShader>>
§camera_nodes: Vec<usize>
Implementations§
Source§impl Root
impl Root
pub fn from_gltf(imp: &ImportData, base_path: &Path) -> Self
Sourcepub fn unsafe_get_node_mut(&mut self, index: usize) -> &'static mut Node
pub fn unsafe_get_node_mut(&mut self, index: usize) -> &'static mut Node
Get a mutable reference to a node without borrowing Self
or Self::nodes
.
Safe for tree traversal (visiting each node ONCE and NOT keeping a reference)
as long as the gltf is valid, i.e. the scene actually is a tree.
Sourcepub fn get_camera_node(&self, index: usize) -> &Node
pub fn get_camera_node(&self, index: usize) -> &Node
Note: index refers to the vec of camera node indices!
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Root
impl RefUnwindSafe for Root
impl !Send for Root
impl !Sync for Root
impl Unpin for Root
impl UnwindSafe for Root
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<Trait>
(where Trait: Downcast
) to Box<Any>
. Box<Any>
can then be
further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.