pub struct LightAttenuation {
pub constant: f64,
pub linear: f64,
pub quadratic: f64,
pub min_cutoff: f64,
pub max_cutoff: f64,
}Expand description
The attenuation of a point or spot light with the distance.
Fields§
§constant: f64The constant term of the denominator.
linear: f64The term proportional to the distance.
quadratic: f64The term proportional to the square of the distance.
min_cutoff: f64The distance up to which the light is attenuated as at this distance.
max_cutoff: f64The distance beyond which the light lights nothing.
Implementations§
Source§impl LightAttenuation
impl LightAttenuation
Sourcepub const NONE: LightAttenuation
pub const NONE: LightAttenuation
No attenuation (the default of WinUI: constant 1).
Sourcepub fn factor(&self, distance: f64) -> f64
pub fn factor(&self, distance: f64) -> f64
The factor of the light at distance: none beyond the maximum
cutoff, 1 / (constant + linear * d + quadratic * d^2) with the
distance raised to the minimum cutoff otherwise (1 when the
denominator is not positive).
Deviation (winui-composition.md): WinUI does not say how the cutoffs apply; closer than the minimum cutoff the light is attenuated as at the cutoff, beyond the maximum cutoff it lights nothing.
Trait Implementations§
Source§impl Clone for LightAttenuation
impl Clone for LightAttenuation
impl Copy for LightAttenuation
Source§impl Debug for LightAttenuation
impl Debug for LightAttenuation
Source§impl PartialEq for LightAttenuation
impl PartialEq for LightAttenuation
impl StructuralPartialEq for LightAttenuation
Auto Trait Implementations§
impl Freeze for LightAttenuation
impl RefUnwindSafe for LightAttenuation
impl Send for LightAttenuation
impl Sync for LightAttenuation
impl Unpin for LightAttenuation
impl UnsafeUnpin for LightAttenuation
impl UnwindSafe for LightAttenuation
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more