diff --git a/src/render/light_aggregate.rs b/src/render/light_aggregate.rs index 2407c24..aecb6e9 100644 --- a/src/render/light_aggregate.rs +++ b/src/render/light_aggregate.rs @@ -27,6 +27,18 @@ impl LightAggregate { spots, } } + + pub fn ambient_lights_iter(&self) -> impl Iterator { + self.ambients.iter().map(|l| l as &dyn Light) + } + + pub fn spatial_lights_iter(&self) -> impl Iterator { + self.directionals + .iter() + .map(|l| l as &dyn SpatialLight) + .chain(self.points.iter().map(|l| l as &dyn SpatialLight)) + .chain(self.spots.iter().map(|l| l as &dyn SpatialLight)) + } } impl Default for LightAggregate {