pub struct Environment {
pub sun: Option<Entity>,
pub ambient: Option<Ambient>,
}Expand description
The scene’s environment as the source authored it. sun: the entity whose directional core.light the source
names as its sun (a scene setting naming one light, not the brightest light a writer picks); None when the source
names none, or in a part of a world that does not hold the sun (a subset or a cell). ambient: the scene’s ambient
light (Ambient); None when the source states none or a lowering has not stated its meaning. Sky and fog are
not here until their meaning and units are established for a source.
Fields§
§sun: Option<Entity>§ambient: Option<Ambient>Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§impl Debug for Environment
impl Debug for Environment
Source§impl Default for Environment
impl Default for Environment
Source§impl PartialEq for Environment
impl PartialEq for Environment
Source§impl Resource for Environment
impl Resource for Environment
Source§fn verify(&self, w: &World) -> Result<(), String>
fn verify(&self, w: &World) -> Result<(), String>
The sun is a directional light; the ambient is finite and not negative.
const NAME: &'static str = "core.environment"
Source§fn references(&self, out: &mut Vec<Entity>)
fn references(&self, out: &mut Vec<Entity>)
The entities this resource refers to, appended to
out. A resource holding entity references must declare
every one of them and implement Resource::retain_references.Source§fn retain_references(&mut self, keep: &dyn Fn(Entity) -> bool)
fn retain_references(&mut self, keep: &dyn Fn(Entity) -> bool)
Forget every reference to an entity
keep refuses (set it to “none”). The world calls it whenever entities
leave it (World::despawn, World::retain, World::move_components) and on the copy a
World::subset or World::split_off part gets, so a resource never refers to an entity its world lacks.Source§impl Serialize for Environment
impl Serialize for Environment
impl StructuralPartialEq for Environment
Auto Trait Implementations§
impl Forget for Environment
impl Freeze for Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl UnwindSafe for Environment
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