pub struct SpriteInstance {
pub model_id: u32,
pub transform: SpriteInstanceTransform,
pub material: u8,
pub alpha_mul: u8,
pub flags: u32,
pub tint: u32,
}Expand description
One sprite instance: a model reference + world pose.
Fields§
§model_id: u32LOD-chain id from SpriteModelRegistry::add / add_lod —
which model this instance draws. The per-frame cull substitutes
the distance-picked concrete mip entry.
transform: SpriteInstanceTransformWorld pose: inverse model→world rotation/scale + position (see
SpriteInstanceTransform::from_sprite).
material: u8Voxel-material id (TV stage): indexes the renderer’s global material
palette for this instance’s opacity + blend mode. 0 (the default)
is opaque, so an unset instance renders unchanged.
alpha_mul: u8Per-instance alpha multiplier (TV stage), 0..=255 (255 =
unscaled, the default).
flags: u32XS.4 — sprite shadow flags (roxlap_formats::sprite bits 4/5:
NO_SHADOW_CAST / NO_SHADOW_RECEIVE). 0 (default) ⇒ casts +
receives. Only honoured when the device is sprite-shadow capable.
tint: u32Per-instance RGB tint, packed 0x00RRGGBB (white 0x00FF_FFFF = no-op).
Implementations§
Source§impl SpriteInstance
impl SpriteInstance
Sourcepub fn new(model_id: u32, transform: SpriteInstanceTransform) -> Self
pub fn new(model_id: u32, transform: SpriteInstanceTransform) -> Self
A model reference + pose with the default opaque material
(material = 0, alpha_mul = 255), shadows on (flags = 0), and no
tint (0x00FF_FFFF).
Trait Implementations§
Source§impl Clone for SpriteInstance
impl Clone for SpriteInstance
Source§fn clone(&self) -> SpriteInstance
fn clone(&self) -> SpriteInstance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more