pub struct SpriteInstance {
pub model_id: u32,
pub transform: SpriteInstanceTransform,
pub material: u8,
pub alpha_mul: u8,
}Expand description
One sprite instance: a model reference + world pose.
Fields§
§model_id: u32§transform: SpriteInstanceTransform§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).
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).
Trait Implementations§
Source§impl Clone for SpriteInstance
impl Clone for SpriteInstance
Source§fn clone(&self) -> SpriteInstance
fn clone(&self) -> SpriteInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SpriteInstance
Auto Trait Implementations§
impl Freeze for SpriteInstance
impl RefUnwindSafe for SpriteInstance
impl Send for SpriteInstance
impl Sync for SpriteInstance
impl Unpin for SpriteInstance
impl UnsafeUnpin for SpriteInstance
impl UnwindSafe for SpriteInstance
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
Mutably borrows from an owned value. Read more