pub struct RectAreaLight {
pub centre: [f32; 3],
pub normal: [f32; 3],
pub half_size: [f32; 2],
pub color: [f32; 3],
pub intensity: f32,
pub range: f32,
pub two_sided: bool,
}Expand description
A rectangular area light: a glowing panel that lights the scene from its whole surface rather than from a single point.
Unlike a PointLight or SpotLight, the softness of the shadow terminator and the shape of the specular highlight follow the panel’s real dimensions, so a wide softbox wraps light around a surface and leaves a stretched rectangular reflection on glossy materials. Use it for windows, ceiling panels, screens, and practical lights.
The panel is positioned by centre, oriented by normal (the direction it
emits), and sized by half_size, matching GlassPanel.
RectAreaLight {
centre: [0.0, 3.0, -4.0],
normal: [0.0, 0.0, 1.0],
half_size: [1.5, 1.0],
color: [1.0, 0.95, 0.85],
intensity: 12.0,
range: 18.0,
..Default::default()
};Fields§
§centre: [f32; 3]World-space position of the panel’s centre.
normal: [f32; 3]Direction the panel emits. Normalised on load; defaults to +Z when
degenerate.
half_size: [f32; 2]Half-width and half-height of the panel, in world units.
color: [f32; 3]Linear-space RGB colour of the light.
intensity: f32Intensity multiplier applied to the colour.
range: f32Maximum reach in world units; attenuation is zero at this distance.
two_sided: boolWhen true the panel emits from both faces. A one-sided panel lights only
the half-space its normal points into.
Trait Implementations§
Source§impl Clone for RectAreaLight
impl Clone for RectAreaLight
Source§fn clone(&self) -> RectAreaLight
fn clone(&self) -> RectAreaLight
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for RectAreaLight
impl Component for RectAreaLight
Source§const NAME: &'static str = "RectAreaLight"
const NAME: &'static str = "RectAreaLight"
Source§fn from_baked(bytes: &[u8]) -> Result<RectAreaLight, CnResult>
fn from_baked(bytes: &[u8]) -> Result<RectAreaLight, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Source§impl ComponentSlot for RectAreaLight
impl ComponentSlot for RectAreaLight
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<RectAreaLight>
fn slot(s: &ComponentStorage) -> &Column<RectAreaLight>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<RectAreaLight>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<RectAreaLight>
Source§impl Debug for RectAreaLight
impl Debug for RectAreaLight
Source§impl Default for RectAreaLight
impl Default for RectAreaLight
Source§fn default() -> RectAreaLight
fn default() -> RectAreaLight
Source§impl<'de> Deserialize<'de> for RectAreaLightwhere
RectAreaLight: Default,
impl<'de> Deserialize<'de> for RectAreaLightwhere
RectAreaLight: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RectAreaLight, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RectAreaLight, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<RectAreaLight> for ComponentAsset
impl From<RectAreaLight> for ComponentAsset
Source§fn from(c: RectAreaLight) -> ComponentAsset
fn from(c: RectAreaLight) -> ComponentAsset
Source§impl RectAreaLightGeometry for RectAreaLight
impl RectAreaLightGeometry for RectAreaLight
Source§fn unit_normal(&self) -> [f32; 3]
fn unit_normal(&self) -> [f32; 3]
Unit-length emission direction, falling back to straight down when the
authored normal is degenerate (the panel default emits downward).
impl RuntimeComponent for RectAreaLight
Source§impl Serialize for RectAreaLight
impl Serialize for RectAreaLight
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for RectAreaLight
impl RefUnwindSafe for RectAreaLight
impl Send for RectAreaLight
impl Sync for RectAreaLight
impl Unpin for RectAreaLight
impl UnsafeUnpin for RectAreaLight
impl UnwindSafe for RectAreaLight
Blanket Implementations§
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
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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> ⓘ
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> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().