pub struct Scene {Show 14 fields
pub name: String,
pub path: Option<String>,
pub entities: Vec<SceneEntity>,
pub is_dirty: bool,
pub ambient_color: Vec3,
pub ambient_intensity: f32,
pub skybox_material: Option<u64>,
pub fog_enabled: bool,
pub fog_color: Vec3,
pub fog_density: f32,
pub gravity: Vec3,
pub time_scale: f32,
pub physics_layer_matrix: [[bool; 32]; 32],
pub next_entity_id: u64,
}Fields§
§name: String§path: Option<String>§entities: Vec<SceneEntity>§is_dirty: bool§ambient_color: Vec3§ambient_intensity: f32§skybox_material: Option<u64>§fog_enabled: bool§fog_color: Vec3§fog_density: f32§gravity: Vec3§time_scale: f32§physics_layer_matrix: [[bool; 32]; 32]§next_entity_id: u64Implementations§
Source§impl Scene
impl Scene
pub fn new(name: impl Into<String>) -> Self
pub fn create_entity(&mut self, name: impl Into<String>) -> u64
pub fn destroy_entity(&mut self, id: u64)
pub fn set_parent(&mut self, child_id: u64, parent_id: Option<u64>)
pub fn find_entity(&self, id: u64) -> Option<&SceneEntity>
pub fn find_entity_mut(&mut self, id: u64) -> Option<&mut SceneEntity>
pub fn find_by_name(&self, name: &str) -> Option<&SceneEntity>
pub fn root_entities(&self) -> impl Iterator<Item = &SceneEntity>
pub fn entity_count(&self) -> usize
pub fn entities_with_component( &self, kind: ComponentKind, ) -> impl Iterator<Item = &SceneEntity>
pub fn populate_default_scene(&mut self)
pub fn serialize_to_json(&self) -> String
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 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
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,
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<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<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.