pub struct BakeLight {
pub pos: Vec3,
pub radius: f32,
pub strength: f32,
}Expand description
EV.3 — one baked point light (voxlap’s lightsrc[]), consumed by
BakeMode::PointLights from Grid::bake_lights. Baked, not
dynamic: its Lambertian pool is written into the per-voxel
brightness bytes by Grid::bake / Grid::bake_bbox and costs
nothing at render time (both backends just read the byte). For a
flickering/moving light use the runtime LightRig instead.
Fields§
§pos: Vec3Grid-local voxel-space position (the same frame as
Grid::set_voxel).
radius: f32Hard cutoff radius in voxels — the cube-law contribution fades to exactly zero here.
strength: f32Voxlap brightness scale: the byte gain at distance d is
roughly strength · cosθ / d² (cube-law falloff × Lambert), on
the 0–255 brightness-byte scale whose neutral is 128. A wall 5
voxels away therefore gains about strength / 25 — 2000 is a
solid reading-torch, 8000 floods a small cavern.
Trait Implementations§
impl Copy for BakeLight
impl StructuralPartialEq for BakeLight
Auto Trait Implementations§
impl Freeze for BakeLight
impl RefUnwindSafe for BakeLight
impl Send for BakeLight
impl Sync for BakeLight
impl Unpin for BakeLight
impl UnsafeUnpin for BakeLight
impl UnwindSafe for BakeLight
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
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>
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 more