pub struct DirectionalLight {
pub id: LightId,
pub direction: Vec3,
pub color: Vec3,
pub intensity: f32,
pub cast_shadow: bool,
pub shadow_map: Option<ShadowMapConfig>,
pub enabled: bool,
pub angular_size: f32,
}Fields§
§id: LightId§direction: Vec3§color: Vec3§intensity: f32§cast_shadow: bool§shadow_map: Option<ShadowMapConfig>§enabled: bool§angular_size: f32Optional angular diameter for soft shadows (degrees).
Implementations§
Source§impl DirectionalLight
impl DirectionalLight
pub fn sun(direction: Vec3, color: Vec3, intensity: f32) -> Self
pub fn with_shadow(self, cfg: ShadowMapConfig) -> Self
pub fn contribution(&self, n: Vec3) -> Vec3
Sourcepub fn shadow_view_proj(&self, scene_center: Vec3, scene_radius: f32) -> Mat4
pub fn shadow_view_proj(&self, scene_center: Vec3, scene_radius: f32) -> Mat4
Build the view-projection matrix for this light’s shadow pass.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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