pub struct Light { /* private fields */ }Expand description
A light.
When a scene has no light and no Environment, init.js adds a
default hemisphere light and a directional light.
use autumn_plugin_three::{Color, Light};
let sun = Light::directional().intensity(2.5).position([3.0, 5.0, 2.0]);
let sky = Light::hemisphere().ground(Color::hex(0x332211));Implementations§
Source§impl Light
impl Light
Sourcepub const fn new(kind: LightKind) -> Self
pub const fn new(kind: LightKind) -> Self
Makes a light of kind with the defaults for that kind.
Sourcepub const fn directional() -> Self
pub const fn directional() -> Self
A directional light.
Sourcepub const fn hemisphere() -> Self
pub const fn hemisphere() -> Self
A hemisphere light.
Sourcepub const fn color(self, color: Color) -> Self
pub const fn color(self, color: Color) -> Self
Sets the color (the sky color for a hemisphere light).
Sourcepub fn position(self, position: impl Into<Vec3>) -> Self
pub fn position(self, position: impl Into<Vec3>) -> Self
Sets the position. Ambient lights ignore it. For a hemisphere light,
the position sets the sky direction. A non-finite component uses the
default of the kind (LightKind::default_position).
Trait Implementations§
impl Copy for Light
Source§impl From<Light> for SceneObject
impl From<Light> for SceneObject
impl StructuralPartialEq for Light
Auto Trait Implementations§
impl Forget for Light
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§
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,
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> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.