pub struct WorldShadowCtx<'a> {
pub occluder: &'a dyn WorldOccluder,
pub origin: [f64; 3],
pub cols: [[f32; 3]; 3],
pub voxel_world_size: f32,
}Expand description
XS.1 — per-grid context for a cross-scene shadow query: the scene-wide
WorldOccluder plus the current grid’s local→world transform, so a
grid-local shadow ray (the frame shade_dynamic works in) can be lifted
to world space before the scene-wide test. cols[i] is the world-space
image of grid-local axis i (the grid rotation’s columns); origin is the
grid’s world origin.
Fields§
§occluder: &'a dyn WorldOccluderThe scene-wide occlusion oracle every lifted shadow ray is tested against.
origin: [f64; 3]The current grid’s world-space origin — the translation part of
its local→world transform (added to rotated positions;
directions skip it). SC.2 — f64: kept full-precision so a
scaled grid’s large world coordinates survive the lift (see
WorldOccluder).
cols: [[f32; 3]; 3]Columns of the grid’s local→world rotation: cols[i] is the
world-space image of grid-local axis i. Kept orthonormal (pure
rotation) — the grid’s voxel scale rides in voxel_world_size, not
folded into the columns.
voxel_world_size: f32SC.2 — the caster grid’s voxel_world_size (world units per voxel).
The shade works in the grid’s voxel frame, so lifting a shadow ray to
world scales the local position and direction by this (a
voxel offset becomes vws world units). 1.0 for an unscaled grid
(byte-identical to XS.1) and for already-world-space sprites.
Implementations§
Source§impl<'a> WorldShadowCtx<'a>
impl<'a> WorldShadowCtx<'a>
Sourcepub fn identity(occluder: &'a dyn WorldOccluder) -> Self
pub fn identity(occluder: &'a dyn WorldOccluder) -> Self
Identity transform — for shading already in world space (sprites): the grid-local ray IS the world ray.
Trait Implementations§
Source§impl<'a> Clone for WorldShadowCtx<'a>
impl<'a> Clone for WorldShadowCtx<'a>
Source§fn clone(&self) -> WorldShadowCtx<'a>
fn clone(&self) -> WorldShadowCtx<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for WorldShadowCtx<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for WorldShadowCtx<'a>
impl<'a> !UnwindSafe for WorldShadowCtx<'a>
impl<'a> Freeze for WorldShadowCtx<'a>
impl<'a> Send for WorldShadowCtx<'a>
impl<'a> Sync for WorldShadowCtx<'a>
impl<'a> Unpin for WorldShadowCtx<'a>
impl<'a> UnsafeUnpin for WorldShadowCtx<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more