FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    from_light

    fn from_light(light: &Rc<CompositionLight>) -> Option<PointLight>
    

    The handle of light as this class, if it is one.

    Source

    color

    fn color(self: &Self) -> Color
    

    The colour of the light (default white).

    Source

    set_color

    fn set_color(self: &Self, value: Color)
    

    Source

    constant_attenuation

    fn constant_attenuation(self: &Self) -> f32
    

    The constant term of the attenuation (default 1).

    Source

    set_constant_attenuation

    fn set_constant_attenuation(self: &Self, value: f32)
    

    Source

    linear_attenuation

    fn linear_attenuation(self: &Self) -> f32
    

    The term of the attenuation proportional to the distance (default 0).

    Source

    set_linear_attenuation

    fn set_linear_attenuation(self: &Self, value: f32)
    

    Source

    quadratic_attenuation

    fn quadratic_attenuation(self: &Self) -> f32
    

    The term of the attenuation proportional to the square of the distance (default 0).

    Source

    set_quadratic_attenuation

    fn set_quadratic_attenuation(self: &Self, value: f32)
    

    Source

    coordinate_space

    fn coordinate_space(self: &Self) -> Option<Rc<CompositionVisual>>
    

    The visual whose coordinates Offset is in; None for the targeted visual.

    Source

    set_coordinate_space

    fn set_coordinate_space(self: &Self, value: Option<Rc<CompositionVisual>>)
    

    Source

    offset

    fn offset(self: &Self) -> Vector3D
    

    The position of the light in its coordinate space; Z is the height above the visuals.

    Source

    set_offset

    fn set_offset(self: &Self, value: Vector3D)
    

    Source

    intensity

    fn intensity(self: &Self) -> f32
    

    The intensity of the light (default 1).

    Source

    set_intensity

    fn set_intensity(self: &Self, value: f32)
    

    Source

    min_attenuation_cutoff

    fn min_attenuation_cutoff(self: &Self) -> f32
    

    The distance up to which the light is not attenuated (default 0).

    Source

    set_min_attenuation_cutoff

    fn set_min_attenuation_cutoff(self: &Self, value: f32)
    

    Source

    max_attenuation_cutoff

    fn max_attenuation_cutoff(self: &Self) -> f32
    

    The distance beyond which the light lights nothing (default f32::MAX).

    Source

    set_max_attenuation_cutoff

    fn set_max_attenuation_cutoff(self: &Self, value: f32)
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Deref

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.