use crate::sampler::{Sampler, SamplerPoint};
use rand::prelude::*;
#[derive(Clone)]
pub struct Light<R: Rng> {
pub location: SamplerPoint<R>,
pub power: Sampler<f64, R>,
pub polar_distance: Sampler<f64, R>,
pub polar_angle: Sampler<f64, R>,
pub ray_angle: Sampler<f64, R>,
pub wavelength: Sampler<f64, R>,
}
impl<R> Light<R>
where
R: Rng,
{
pub fn new<A, B, C, D, E, F>(
location: A,
power: B,
polar_distance: C,
polar_angle: D,
ray_angle: E,
wavelength: F,
) -> Self
where
A: Into<SamplerPoint<R>>,
B: Into<Sampler<f64, R>>,
C: Into<Sampler<f64, R>>,
D: Into<Sampler<f64, R>>,
E: Into<Sampler<f64, R>>,
F: Into<Sampler<f64, R>>,
{
Self {
location: location.into(),
power: power.into(),
polar_distance: polar_distance.into(),
polar_angle: polar_angle.into(),
ray_angle: ray_angle.into(),
wavelength: wavelength.into(),
}
}
}