use ecs::{Component, Sole}; use crate::color::Color; use crate::util::builder; #[derive(Debug, Clone, Component)] pub struct LightSource { pub ambient: Color, pub diffuse: Color, pub specular: Color, } impl Default for LightSource { fn default() -> Self { Self { ambient: Color { red: 0.2, green: 0.2, blue: 0.2 }, diffuse: Color { red: 0.5, green: 0.5, blue: 0.5 }, specular: Color { red: 1.0, green: 1.0, blue: 1.0 }, } } } builder! { /// Global light properties. #[builder(name = GlobalLightBuilder, derives = (Debug, Clone, Default))] #[derive(Debug, Clone, Default, Sole)] #[non_exhaustive] pub struct GlobalLight { pub ambient_offset: Color, } } impl GlobalLight { pub fn builder() -> GlobalLightBuilder { GlobalLightBuilder::default() } }