pub struct GridWorldTransform {
pub origin: [f32; 3],
pub rot_cols: [[f32; 3]; 3],
pub voxel_world_size: f32,
pub z_clip: Option<i32>,
pub cutaway_footprint: Option<([f32; 2], [f32; 2])>,
pub cutout_focus_z: i32,
pub cutout_focus_local: [f32; 3],
}Expand description
XS.3 — a grid’s world transform for cross-grid shadows: world origin +
the local→world rotation columns (rot_cols[i] = world image of grid-local
axis i). Built host-side per frame from the grid’s GridTransform and
handed to SceneRenderer::render_scene alongside the per-grid cameras.
Fields§
§origin: [f32; 3]World position of the grid’s local origin, voxel units.
rot_cols: [[f32; 3]; 3]Local→world rotation as columns: rot_cols[i] is the world
image of grid-local axis i (unit vectors for a pure rotation).
Identity for an unrotated grid.
voxel_world_size: f32SC.4 — world units per voxel. The scene DDA marcher scales its
chunk/voxel cell dimensions by this, so a scaled grid renders,
shadows, and composites at its true world footprint. 1.0 for an
unscaled grid (byte-identical to pre-SC).
z_clip: Option<i32>CA.0 — the grid’s cutaway clip (Grid::z_clip host-side):
grid-local absolute voxel z below which (z < z_clip, z-down)
the grid renders as air. None (the default) = no clip,
byte-identical to pre-CA renders.
cutaway_footprint: Option<([f32; 2], [f32; 2])>CA.4 — the grid’s materialised XY chunk footprint [lo, hi) in
grid-local voxel coords, for the sprite footprint rule. Must
come from the HOST’s scene (all materialised chunks — what
Grid::cutaway_hides_point tests), not the GPU-resident slot
subset, so both backends hide the same sprites on streaming
grids. Only consulted when Self::z_clip is set; None ⇒
the clip hides no sprites (an empty grid).
cutout_focus_z: i32OC.0 — the view cutout’s focus-plane z in this grid’s local
frame (absolute voxel z, z-down, mip-0; z-bias already
folded in by the facade — the identical world→grid conversion
the CPU path runs, so both backends cut the same plane). The
kernel’s per-cell hide rule gates on z < cutout_focus_z >> mip
FIRST, so i32::MIN (the default) disables it for one
never-true compare — the same sentinel the CPU sampler uses.
cutout_focus_local: [f32; 3]OC — the view cutout’s focus point in this grid’s local frame,
march units (world units within the grid frame — the
grid-local voxel focus × voxel_world_size), converted
host-side by the same shared roxlap-scene helper the CPU
path uses. [0.0; 3] while the cutout is off.
Trait Implementations§
Source§impl Clone for GridWorldTransform
impl Clone for GridWorldTransform
Source§fn clone(&self) -> GridWorldTransform
fn clone(&self) -> GridWorldTransform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more