pub struct LightSrc {
pub pos: [f32; 3],
pub r2: f32,
pub sc: f32,
}Expand description
One point light source for sprite (and, eventually, world) lighting.
Mirror of voxlap’s lightsrc_t (voxlap5.h): position, squared
reach radius, and intensity scale. The lighting math reads r2
not r, matching voxlap’s vx5.lightsrc[i].r2-keyed range
check.
Fields§
§pos: [f32; 3]World-space position.
r2: f32Squared influence radius. Voxels / sprites further than
sqrt(r2) from pos get no contribution.
sc: f32Intensity scale — voxlap’s lightsrc_t::sc. Larger = brighter.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LightSrc
impl RefUnwindSafe for LightSrc
impl Send for LightSrc
impl Sync for LightSrc
impl Unpin for LightSrc
impl UnsafeUnpin for LightSrc
impl UnwindSafe for LightSrc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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