pub struct LightEngine { /* private fields */ }Implementations§
Source§impl LightEngine
impl LightEngine
pub fn new() -> Self
pub fn place_light( &mut self, access: &impl VoxelAccess, pos: [i32; 3], level: u8, ) -> Vec<LightUpdate>
pub fn remove_light( &mut self, access: &impl VoxelAccess, pos: [i32; 3], ) -> Vec<LightUpdate>
pub fn block_placed( &mut self, access: &impl VoxelAccess, pos: [i32; 3], ) -> Vec<LightUpdate>
pub fn block_removed( &mut self, access: &impl VoxelAccess, pos: [i32; 3], ) -> Vec<LightUpdate>
Sourcepub fn recalculate_area(
&mut self,
access: &impl VoxelAccess,
center: [i32; 3],
radius: i32,
) -> Vec<LightUpdate>
pub fn recalculate_area( &mut self, access: &impl VoxelAccess, center: [i32; 3], radius: i32, ) -> Vec<LightUpdate>
Clear all light in a cubic area and re-propagate from any emitters found.
Use when an opaque block is placed and you need to recalculate the area rather than tracing individual affected paths.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LightEngine
impl RefUnwindSafe for LightEngine
impl Send for LightEngine
impl Sync for LightEngine
impl Unpin for LightEngine
impl UnsafeUnpin for LightEngine
impl UnwindSafe for LightEngine
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