Skip to main content

GridWorldTransform

Struct GridWorldTransform 

Source
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: f32

SC.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: i32

OC.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

Source§

fn clone(&self) -> GridWorldTransform

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GridWorldTransform

Source§

impl Default for GridWorldTransform

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,