pub struct DecalRecord {
pub model: [[f32; 4]; 4],
pub inv_model: [[f32; 4]; 4],
pub texture_slot: usize,
pub tint: [f32; 4],
}Expand description
Per-decal data the renderer consumes each frame. Built once at
GraphicsSystem init from the world’s Decal components.
model is the local→world transform of a unit cube spanning [-0.5, 0.5]^3
in local space. inv_model is its inverse; the fragment shader uses it to
pull a reconstructed world-space sample point back into decal-local space
and test it against the unit box. texture_slot indexes the renderer’s
albedo texture pool; tint is RGB×alpha applied to every projected sample.
Fields§
§model: [[f32; 4]; 4]Model matrix, column-major.
inv_model: [[f32; 4]; 4]Inverse model matrix, column-major.
texture_slot: usizeIndex into the shared texture pool for the decal’s image.
tint: [f32; 4]Linear RGBA tint multiplied into the sampled image.
Implementations§
Source§impl DecalRecord
impl DecalRecord
Sourcepub fn aabb(&self) -> ([f32; 3], [f32; 3])
pub fn aabb(&self) -> ([f32; 3], [f32; 3])
World-space AABB enclosing the decal’s unit-cube volume. Used by the
per-frame frustum-cull skip so a record that lands fully outside the
camera frustum costs no draw call. The AABB is the transform of
[-0.5, 0.5]^3 by model; for a non-rotated decal this exactly
matches the authored size, and for a rotated decal it is the
minimum AABB enclosing the rotated box.
Trait Implementations§
Source§impl Clone for DecalRecord
impl Clone for DecalRecord
Source§fn clone(&self) -> DecalRecord
fn clone(&self) -> DecalRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DecalRecord
Source§impl Debug for DecalRecord
impl Debug for DecalRecord
Source§impl PartialEq for DecalRecord
impl PartialEq for DecalRecord
impl StructuralPartialEq for DecalRecord
Auto Trait Implementations§
impl Freeze for DecalRecord
impl RefUnwindSafe for DecalRecord
impl Send for DecalRecord
impl Sync for DecalRecord
impl Unpin for DecalRecord
impl UnsafeUnpin for DecalRecord
impl UnwindSafe for DecalRecord
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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