pub struct DirectionalLight {
pub direction: Vec3,
pub color: Color,
pub intensity: f32,
pub shadow: Option<ShadowConfig>,
}Expand description
Directional light with optional shadow configuration.
Fields§
§direction: Vec3Direction the light shines toward.
color: ColorLight color in linear RGB.
intensity: f32Scalar intensity.
shadow: Option<ShadowConfig>Optional shadow configuration.
Implementations§
Source§impl DirectionalLight
impl DirectionalLight
Sourcepub fn new(direction: Vec3, color: Color, intensity: f32) -> DirectionalLight
pub fn new(direction: Vec3, color: Color, intensity: f32) -> DirectionalLight
Creates a directional light. Zero directions fall back to negative Z.
Sourcepub const fn shadow(self, shadow: ShadowConfig) -> DirectionalLight
pub const fn shadow(self, shadow: ShadowConfig) -> DirectionalLight
Returns this light with shadow configuration.
Trait Implementations§
Source§impl Clone for DirectionalLight
impl Clone for DirectionalLight
Source§fn clone(&self) -> DirectionalLight
fn clone(&self) -> DirectionalLight
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 DirectionalLight
Source§impl Debug for DirectionalLight
impl Debug for DirectionalLight
Source§impl Default for DirectionalLight
impl Default for DirectionalLight
Source§fn default() -> DirectionalLight
fn default() -> DirectionalLight
Returns the “default value” for a type. Read more
Source§impl PartialEq for DirectionalLight
impl PartialEq for DirectionalLight
impl StructuralPartialEq for DirectionalLight
Auto Trait Implementations§
impl Freeze for DirectionalLight
impl RefUnwindSafe for DirectionalLight
impl Send for DirectionalLight
impl Sync for DirectionalLight
impl Unpin for DirectionalLight
impl UnsafeUnpin for DirectionalLight
impl UnwindSafe for DirectionalLight
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