use ecs::{Component, Sole}; use crate::color::Color; use crate::util::builder; #[derive(Debug, Clone, Component)] pub struct LightSource { pub diffuse: Color, pub specular: Color, } impl Default for LightSource { fn default() -> Self { Self { 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: Color, } } impl GlobalLight { #[must_use] pub fn builder() -> GlobalLightBuilder { GlobalLightBuilder::default() } }