Struct Light
pub struct Light {
pub light_type: LightType,
pub colour: [f32; 3],
pub intensity: f32,
pub position: [f32; 3],
pub direction: [f32; 3],
pub inner_cone: f32,
pub outer_cone: f32,
pub range: f32,
pub cast_shadows: bool,
}Expand description
A light source in the scene.
Fields§
§light_type: LightType§colour: [f32; 3]RGB colour (0.0–1.0 per channel).
intensity: f32Intensity (lumens for point/spot, lux for directional, 0–1 for ambient).
position: [f32; 3]World-space position (point/spot).
direction: [f32; 3]Direction (directional/spot).
inner_cone: f32Cone inner angle in radians (spot only).
outer_cone: f32Cone outer angle in radians (spot only).
range: f32Maximum range (point/spot).
cast_shadows: boolWhether the light casts shadows.
Implementations§
§impl Light
impl Light
pub fn directional(
direction: [f32; 3],
colour: [f32; 3],
intensity: f32,
) -> Light
pub fn directional( direction: [f32; 3], colour: [f32; 3], intensity: f32, ) -> Light
Create a directional light.
pub fn spot(
position: [f32; 3],
direction: [f32; 3],
colour: [f32; 3],
intensity: f32,
inner_cone: f32,
outer_cone: f32,
) -> Light
pub fn spot( position: [f32; 3], direction: [f32; 3], colour: [f32; 3], intensity: f32, inner_cone: f32, outer_cone: f32, ) -> Light
Create a spot light.
pub fn with_shadows(self, cast: bool) -> Light
pub fn with_shadows(self, cast: bool) -> Light
Set shadow casting.
pub fn with_range(self, range: f32) -> Light
pub fn with_range(self, range: f32) -> Light
Set range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Light
impl RefUnwindSafe for Light
impl Send for Light
impl Sync for Light
impl Unpin for Light
impl UnsafeUnpin for Light
impl UnwindSafe for Light
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more