PointLight
struct · ferroui-base · v0.5.0
struct PointLight
A light from a point (WinUI Microsoft.UI.Composition.PointLight):
a point of a visual is lit by the cosine of the angle of the light to
the visual, weakened by the attenuation of the distance
1 / (constant + linear * d + quadratic * d^2) between the minimum and
the maximum cutoff. Every member but CoordinateSpace is animatable.
Members
from_lightcolorset_colorconstant_attenuationset_constant_attenuationlinear_attenuationset_linear_attenuationquadratic_attenuationset_quadratic_attenuationcoordinate_spaceset_coordinate_spaceoffsetset_offsetintensityset_intensitymin_attenuation_cutoffset_min_attenuation_cutoffmax_attenuation_cutoffset_max_attenuation_cutoff
from_light
fn from_light(light: &Rc<CompositionLight>) -> Option<PointLight>
The handle of light as this class, if it is one.
color
fn color(self: &Self) -> Color
The colour of the light (default white).
set_color
fn set_color(self: &Self, value: Color)
constant_attenuation
fn constant_attenuation(self: &Self) -> f32
The constant term of the attenuation (default 1).
set_constant_attenuation
fn set_constant_attenuation(self: &Self, value: f32)
linear_attenuation
fn linear_attenuation(self: &Self) -> f32
The term of the attenuation proportional to the distance (default 0).
set_linear_attenuation
fn set_linear_attenuation(self: &Self, value: f32)
quadratic_attenuation
fn quadratic_attenuation(self: &Self) -> f32
The term of the attenuation proportional to the square of the distance (default 0).
set_quadratic_attenuation
fn set_quadratic_attenuation(self: &Self, value: f32)
coordinate_space
fn coordinate_space(self: &Self) -> Option<Rc<CompositionVisual>>
The visual whose coordinates Offset is in; None for the targeted
visual.
set_coordinate_space
fn set_coordinate_space(self: &Self, value: Option<Rc<CompositionVisual>>)
offset
fn offset(self: &Self) -> Vector3D
The position of the light in its coordinate space; Z is the height above the visuals.
set_offset
fn set_offset(self: &Self, value: Vector3D)
intensity
fn intensity(self: &Self) -> f32
The intensity of the light (default 1).
set_intensity
fn set_intensity(self: &Self, value: f32)
min_attenuation_cutoff
fn min_attenuation_cutoff(self: &Self) -> f32
The distance up to which the light is not attenuated (default 0).
set_min_attenuation_cutoff
fn set_min_attenuation_cutoff(self: &Self, value: f32)
max_attenuation_cutoff
fn max_attenuation_cutoff(self: &Self) -> f32
The distance beyond which the light lights nothing (default
f32::MAX).
set_max_attenuation_cutoff
fn set_max_attenuation_cutoff(self: &Self, value: f32)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDeref
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.