pub struct Light {
pub direction: Vec3I16,
pub colour: (i16, i16, i16),
}Expand description
A single directional light in some reference frame (caller’s choice of world / object / eye space).
Fields§
§direction: Vec3I16Direction FROM the surface TOWARD the light source. Q3.12 unit vector; if you computed a “light-to-surface” direction instead, negate it before storing here.
colour: (i16, i16, i16)Per-channel intensity in Q3.12 (0x1000 = full intensity,
0x0800 = half, 0x2000 = double / over-bright). The GTE
clamps out-of-range values at the MAC stage.
Implementations§
Source§impl Light
impl Light
Sourcepub const OFF: Self
pub const OFF: Self
Null light – contributes nothing. Use as a filler for unused slots in a rig.
Sourcepub const fn warm_white_at(direction: Vec3I16) -> Self
pub const fn warm_white_at(direction: Vec3I16) -> Self
Convenience constructor for a “warm-white at 75%” feel – useful while prototyping light rigs.
Sourcepub const fn cool_fill_at(direction: Vec3I16) -> Self
pub const fn cool_fill_at(direction: Vec3I16) -> Self
“Cool fill” preset – bluish, dimmer, useful as a secondary / rim light.
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<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)