Files
shacraft-core/client/local-light-bounds.js
Emil c7e86663d8
MVP checks / mvp (push) Canceled after 0s
Expand voxel gameplay, lighting, full-height streaming and world imports
Add shared Rust/WASM physics, worker meshing and diagnostics, 64-chunk full-height streaming, atlas texture support, and baseline world import. Document the current implementation and include the supplied in-game lobby screenshot.
2026-09-17 02:10:53 +03:00

11 lines
491 B
JavaScript

// Fifteen light levels plus the halo sampled by faces and partial models.
export const LOCAL_LIGHT_HALO = 18;
export function localLightBounds(id, view) {
if (!view) return null;
const [x,,z] = id.split(',').map(value=>Math.floor(Number(value)/2)*32);
return {
min:[Math.max(view.min[0],x-LOCAL_LIGHT_HALO),view.min[1],Math.max(view.min[2],z-LOCAL_LIGHT_HALO)],
max:[Math.min(view.max[0],x+31+LOCAL_LIGHT_HALO),view.max[1],Math.min(view.max[2],z+31+LOCAL_LIGHT_HALO)],
};
}