#[non_exhaustive]pub struct SpriteItem {Show 14 fields
pub texture_id: Option<u64>,
pub positions: Vec<[f32; 3]>,
pub colours: Vec<[f32; 4]>,
pub sizes: Vec<f32>,
pub rotations: Vec<f32>,
pub uv_rects: Vec<[f32; 4]>,
pub default_colour: [f32; 4],
pub default_size: f32,
pub size_mode: SpriteSizeMode,
pub model: [[f32; 4]; 4],
pub depth_write: bool,
pub id: u64,
pub appearance: AppearanceSettings,
pub selected: bool,
}Expand description
A batch of instanced billboard sprites rendered as camera-facing textured quads.
Each instance is one billboard at a world-space position. All instances in the batch share
one texture (or render as solid-colour quads when texture_id is None). Per-instance
colour, size, rotation, and atlas UV rect are specified via parallel Vec fields; empty
vecs fall back to the batch defaults.
§Particle effects
Submit a new SpriteItem each frame with updated positions and colours to animate
CPU-simulated particle effects. The host application owns simulation state (velocity,
lifetime, emission); the renderer only handles drawing.
§Texture atlases
Set uv_rects to select sub-regions of the texture per sprite, enabling flip-book
animation or mixed icon sets from a single atlas texture.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.texture_id: Option<u64>Texture ID from [ViewportGpuResources::upload_texture].
None renders solid-colour quads using colours / default_colour only.
positions: Vec<[f32; 3]>World-space positions, one per sprite instance.
colours: Vec<[f32; 4]>Per-instance RGBA colour tints. Empty = use default_colour for all.
Multiplied with the texture sample (or used directly when texture_id is None).
sizes: Vec<f32>Per-instance sizes. Empty = use default_size for all.
Interpretation depends on size_mode.
rotations: Vec<f32>Per-instance rotation angles in radians, CCW around the camera-forward axis. Empty = no rotation applied.
uv_rects: Vec<[f32; 4]>Per-instance UV rects [u0, v0, u1, v1] selecting atlas sub-regions.
Empty = full texture [0.0, 0.0, 1.0, 1.0] for all.
default_colour: [f32; 4]Fallback RGBA colour tint used when colours is empty. Default: opaque white.
default_size: f32Default size when sizes is empty. Pixels (ScreenSpace) or world units (WorldSpace).
size_mode: SpriteSizeModeWhether sizes are in screen-space pixels or world-space units.
model: [[f32; 4]; 4]World-space model transform applied to all positions. Default: identity.
depth_write: boolWhether this batch writes to the depth buffer. Default: false.
Set false for transparent or additive particle effects so sprites do not occlude
each other based on submission order. Set true for opaque world-space markers
that should participate in depth testing normally.
id: u64Picking ID. 0 = not pickable.
appearance: AppearanceSettingsPer-item appearance overrides (hidden, unlit, opacity, wireframe).
selected: boolWhether this sprite set is selected at object level. When true and
InteractionFrame::outline_selected is set, the renderer draws a smooth
outline ring around the sprite positions. Default: false.
Trait Implementations§
Source§impl Clone for SpriteItem
impl Clone for SpriteItem
Source§fn clone(&self) -> SpriteItem
fn clone(&self) -> SpriteItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SpriteItem
impl RefUnwindSafe for SpriteItem
impl Send for SpriteItem
impl Sync for SpriteItem
impl Unpin for SpriteItem
impl UnsafeUnpin for SpriteItem
impl UnwindSafe for SpriteItem
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.