Struct ascending_graphics::Lights
source · pub struct Lights {
pub world_color: Vec4,
pub enable_lights: bool,
pub store_id: Index,
pub order: DrawOrder,
pub render_layer: u32,
pub area_lights: Slab<AreaLight>,
pub directional_lights: Slab<DirectionalLight>,
pub area_count: u32,
pub dir_count: u32,
pub changed: bool,
pub directionals_changed: bool,
pub areas_changed: bool,
}Expand description
rendering data for world Light and all Lights.
Fields§
§world_color: Vec4§enable_lights: bool§store_id: Index§order: DrawOrder§render_layer: u32§area_lights: Slab<AreaLight>§directional_lights: Slab<DirectionalLight>§area_count: u32§dir_count: u32§changed: boolif anything got updated we need to update the buffers too.
directionals_changed: bool§areas_changed: boolImplementations§
source§impl Lights
impl Lights
pub fn new(renderer: &mut GpuRenderer, render_layer: u32) -> Self
pub fn create_quad(&mut self, renderer: &mut GpuRenderer)
pub fn insert_area_light(&mut self, light: AreaLight) -> Option<usize>
pub fn remove_area_light(&mut self, key: usize)
pub fn get_mut_area_light(&mut self, key: usize) -> Option<&mut AreaLight>
pub fn insert_directional_light( &mut self, light: DirectionalLight ) -> Option<usize>
pub fn remove_directional_light(&mut self, key: usize)
pub fn get_mut_directional_light( &mut self, key: usize ) -> Option<&mut DirectionalLight>
sourcepub fn update(
&mut self,
renderer: &mut GpuRenderer,
areas: &mut Buffer,
dirs: &mut Buffer
) -> OrderedIndex
pub fn update( &mut self, renderer: &mut GpuRenderer, areas: &mut Buffer, dirs: &mut Buffer ) -> OrderedIndex
used to check and update the vertex array.
Auto Trait Implementations§
impl Freeze for Lights
impl RefUnwindSafe for Lights
impl Send for Lights
impl Sync for Lights
impl Unpin for Lights
impl UnwindSafe for Lights
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<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.