pub struct WorldShadowCtx<'a> {
pub occluder: &'a dyn WorldOccluder,
pub origin: [f32; 3],
pub cols: [[f32; 3]; 3],
}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: [f32; 3]The current grid’s world-space origin — the translation part of its local→world transform (added to rotated positions; directions skip it).
cols: [[f32; 3]; 3]Columns of the grid’s local→world rotation: cols[i] is the
world-space image of grid-local axis i. Assumed orthonormal
so grid-local ray lengths equal world lengths.
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