pub enum LightSource {
Ambient {
color: LightColor,
},
Distant {
color: LightColor,
direction: Vector3D,
},
Point {
color: LightColor,
position: Vector3D,
attenuation: LightAttenuation,
},
Spot {
inner_color: LightColor,
outer_color: LightColor,
position: Vector3D,
direction: Vector3D,
inner_cone_angle: f64,
outer_cone_angle: f64,
attenuation: LightAttenuation,
},
}Expand description
A light in its coordinate space, on the plane z = 0 of that space.
Variants§
Ambient
The same light everywhere.
Fields
§
color: LightColorDistant
A light from far away shining in direction.
Point
A light at position.
Spot
A light at position shining into the cones around direction.
Implementations§
Source§impl LightSource
impl LightSource
Sourcepub fn light_at(&self, point: Point) -> LightColor
pub fn light_at(&self, point: Point) -> LightColor
The light at point of the plane z = 0 (not clamped).
Source§impl LightSource
impl LightSource
Sourcepub fn lit_at(&self, point: Point, material: &LightingMaterial) -> LightColor
pub fn lit_at(&self, point: Point, material: &LightingMaterial) -> LightColor
The light at point of the plane z = 0 reflected by material
(not clamped): the ambient light times the ambient amount, the other
lights times the diffuse amount and N.L, plus their specular
highlight times the specular amount.
Trait Implementations§
Source§impl Clone for LightSource
impl Clone for LightSource
impl Copy for LightSource
Source§impl Debug for LightSource
impl Debug for LightSource
Source§impl PartialEq for LightSource
impl PartialEq for LightSource
impl StructuralPartialEq for LightSource
Auto Trait Implementations§
impl Freeze for LightSource
impl RefUnwindSafe for LightSource
impl Send for LightSource
impl Sync for LightSource
impl Unpin for LightSource
impl UnsafeUnpin for LightSource
impl UnwindSafe for LightSource
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more