use super::ShadowSettings;
use crate::math::{Color, Vector3};
#[derive(Debug, Clone, Copy)]
pub struct DirectionalLight {
pub color: Color,
pub intensity: f32,
pub direction: Vector3,
pub cast_shadow: bool,
pub shadow: ShadowSettings,
}
impl Default for DirectionalLight {
fn default() -> Self {
Self::new(Color::WHITE, 1.0)
}
}
impl DirectionalLight {
pub fn new(color: Color, intensity: f32) -> Self {
Self {
color,
intensity,
direction: Vector3::new(0.0, -1.0, 0.0),
cast_shadow: false,
shadow: ShadowSettings::default(),
}
}
pub fn with_direction(mut self, direction: Vector3) -> Self {
self.direction = direction;
self
}
}