better lighting

This commit is contained in:
asrael 2026-01-31 09:31:17 -06:00
parent 805a2713a3
commit 6ed4e17065
75 changed files with 6417 additions and 3667 deletions

View file

@ -38,10 +38,6 @@ impl World {
self.chunks.remove(id)
}
pub fn set_active(&mut self, id: ChunkId) {
self.active = Some(id);
}
pub fn active(&self) -> Option<&Chunk> {
self.active.as_ref().and_then(|id| self.chunks.get(id))
}
@ -50,6 +46,14 @@ impl World {
self.active
}
pub fn set_active(&mut self, id: ChunkId) {
self.active = Some(id);
}
pub fn clear_active(&mut self) {
self.active = None;
}
pub fn trace(&self, from: Vec3, to: Vec3, radius: f32) -> Vec3 {
if let Some(chunk) = self.active() {
return chunk.trace(from, to, radius);