lights: make intensity parameter generic.
This commit is contained in:
parent
c058d043e0
commit
c500d56d4d
@ -28,10 +28,13 @@ impl PointLight {
|
|||||||
/// assert_eq!(light.position, position);
|
/// assert_eq!(light.position, position);
|
||||||
/// assert_eq!(light.intensity, intensity);
|
/// assert_eq!(light.intensity, intensity);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn new(position: Tuple, intensity: Color) -> PointLight {
|
pub fn new<C>(position: Tuple, intensity: C) -> PointLight
|
||||||
|
where
|
||||||
|
C: Into<Color>,
|
||||||
|
{
|
||||||
PointLight {
|
PointLight {
|
||||||
position,
|
position,
|
||||||
intensity,
|
intensity: intensity.into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user