pub struct SceneNode {
pub name: String,
pub transform: Transform,
pub mesh: Option<MeshBuffers>,
pub children: Vec<SceneNode>,
}Expand description
A node in the scene graph.
Fields§
§name: String§transform: Transform§mesh: Option<MeshBuffers>§children: Vec<SceneNode>Implementations§
Source§impl SceneNode
impl SceneNode
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a new node with the given name, identity transform, no mesh, no children.
Sourcepub fn with_transform(self, t: Transform) -> Self
pub fn with_transform(self, t: Transform) -> Self
Builder-style: set the transform.
Sourcepub fn with_mesh(self, mesh: MeshBuffers) -> Self
pub fn with_mesh(self, mesh: MeshBuffers) -> Self
Builder-style: attach a mesh.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Count total nodes: self plus all descendants (recursive).
Sourcepub fn mesh_count(&self) -> usize
pub fn mesh_count(&self) -> usize
Count nodes that carry a mesh: self (if mesh is Some) plus all descendants.
Auto Trait Implementations§
impl Freeze for SceneNode
impl RefUnwindSafe for SceneNode
impl Send for SceneNode
impl Sync for SceneNode
impl Unpin for SceneNode
impl UnsafeUnpin for SceneNode
impl UnwindSafe for SceneNode
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more