pub struct DirectionalLightSet { /* private fields */ }Expand description
A frame’s directional lights, held inline at the shader’s capacity so a
frame can carry them without allocating. Extras past
MAX_DIRECTIONAL_LIGHTS are dropped, exactly as
directional_light_data drops them.
let sun = DirectionalLight::default();
let set = DirectionalLightSet::collect(core::iter::once(sun));
assert_eq!(set.as_slice().len(), 1);Implementations§
Source§impl DirectionalLightSet
impl DirectionalLightSet
Sourcepub fn collect(lights: impl Iterator<Item = DirectionalLight>) -> Self
pub fn collect(lights: impl Iterator<Item = DirectionalLight>) -> Self
The first MAX_DIRECTIONAL_LIGHTS of lights.
Sourcepub fn as_slice(&self) -> &[DirectionalLight]
pub fn as_slice(&self) -> &[DirectionalLight]
The live lights, in packing order.
Trait Implementations§
Source§impl Clone for DirectionalLightSet
impl Clone for DirectionalLightSet
Source§fn clone(&self) -> DirectionalLightSet
fn clone(&self) -> DirectionalLightSet
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 moreimpl Copy for DirectionalLightSet
Source§impl Debug for DirectionalLightSet
impl Debug for DirectionalLightSet
Source§impl PartialEq for DirectionalLightSet
impl PartialEq for DirectionalLightSet
impl StructuralPartialEq for DirectionalLightSet
Auto Trait Implementations§
impl Freeze for DirectionalLightSet
impl RefUnwindSafe for DirectionalLightSet
impl Send for DirectionalLightSet
impl Sync for DirectionalLightSet
impl Unpin for DirectionalLightSet
impl UnsafeUnpin for DirectionalLightSet
impl UnwindSafe for DirectionalLightSet
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