Struct SceneGraph
pub struct SceneGraph {
pub nodes: BTreeMap<String, SceneNode>,
pub links: Vec<SemanticLink>,
pub render_budget_ms: f32,
}Expand description
The scene graph — a collection of nodes with hierarchy.
Fields§
§nodes: BTreeMap<String, SceneNode>Nodes keyed by ID.
links: Vec<SemanticLink>Semantic links.
render_budget_ms: f32Render budget in milliseconds (0 = unlimited).
Implementations§
§impl SceneGraph
impl SceneGraph
pub fn new() -> SceneGraph
pub fn new() -> SceneGraph
Creates SceneGraph with the given state.
pub fn add_light(&mut self, light_id: &str, light: &Light)
pub fn add_light(&mut self, light_id: &str, light: &Light)
Add a light to the scene (stored as a node with light metadata).
pub fn duplicate(
&mut self,
source_id: &str,
new_id: &str,
parent: Option<&str>,
) -> Option<String>
pub fn duplicate( &mut self, source_id: &str, new_id: &str, parent: Option<&str>, ) -> Option<String>
Duplicate a node and all its children with a new ID prefix.
pub fn link_semantic(&mut self, link: SemanticLink)
pub fn link_semantic(&mut self, link: SemanticLink)
Link a scene node to a semantic entity.
pub fn set_render_budget(&mut self, budget_ms: f32)
pub fn set_render_budget(&mut self, budget_ms: f32)
Set the render budget (milliseconds per frame).
Trait Implementations§
§impl Clone for SceneGraph
impl Clone for SceneGraph
§fn clone(&self) -> SceneGraph
fn clone(&self) -> SceneGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for SceneGraph
impl Debug for SceneGraph
§impl Default for SceneGraph
impl Default for SceneGraph
§fn default() -> SceneGraph
fn default() -> SceneGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SceneGraph
impl RefUnwindSafe for SceneGraph
impl Send for SceneGraph
impl Sync for SceneGraph
impl Unpin for SceneGraph
impl UnsafeUnpin for SceneGraph
impl UnwindSafe for SceneGraph
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.