#[repr(C)]pub struct ParticleState {Show 20 fields
pub position: [f32; 3],
pub lifetime: f32,
pub velocity: [f32; 3],
pub age: f32,
pub acceleration: [f32; 3],
pub mass: f32,
pub rotation: [f32; 4],
pub angular_velocity: [f32; 3],
pub drag: f32,
pub color: [f32; 4],
pub scale: [f32; 2],
pub temperature: f32,
pub energy: f32,
pub emitter_id: u32,
pub material_id: u32,
pub flags: u32,
pub seed: u32,
pub tag_mask_lo: u32,
pub tag_mask_hi: u32,
pub custom_f32: [f32; 2],
}Expand description
GPU-compatible particle state. Layout must match the WGSL struct exactly for GPU buffer uploads. Uses repr(C) for deterministic field ordering.
Fields§
§position: [f32; 3]§lifetime: f32§velocity: [f32; 3]§age: f32§acceleration: [f32; 3]§mass: f32§rotation: [f32; 4]§angular_velocity: [f32; 3]§drag: f32§color: [f32; 4]§scale: [f32; 2]§temperature: f32§energy: f32§emitter_id: u32§material_id: u32§flags: u32§seed: u32§tag_mask_lo: u32§tag_mask_hi: u32§custom_f32: [f32; 2]Implementations§
Source§impl ParticleState
impl ParticleState
Sourcepub const FLAG_ALIVE: u32
pub const FLAG_ALIVE: u32
Particle flag: alive.
Sourcepub const FLAG_PROMOTE_CANDIDATE: u32
pub const FLAG_PROMOTE_CANDIDATE: u32
Particle flag: promotion candidate.
Sourcepub const FLAG_RESTING: u32
pub const FLAG_RESTING: u32
Particle flag: resting (velocity near zero).
Sourcepub const FLAG_COLLIDED: u32
pub const FLAG_COLLIDED: u32
Particle flag: collided this frame.
Sourcepub const FLAG_SIGNAL_CARRIER: u32
pub const FLAG_SIGNAL_CARRIER: u32
Particle flag: signal carrier.
pub fn is_alive(&self) -> bool
pub fn is_promotion_candidate(&self) -> bool
Trait Implementations§
Source§impl Clone for ParticleState
impl Clone for ParticleState
Source§fn clone(&self) -> ParticleState
fn clone(&self) -> ParticleState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParticleState
impl Debug for ParticleState
Source§impl Default for ParticleState
impl Default for ParticleState
Source§impl<'de> Deserialize<'de> for ParticleState
impl<'de> Deserialize<'de> for ParticleState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ParticleState
impl Serialize for ParticleState
impl Copy for ParticleState
Auto Trait Implementations§
impl Freeze for ParticleState
impl RefUnwindSafe for ParticleState
impl Send for ParticleState
impl Sync for ParticleState
impl Unpin for ParticleState
impl UnsafeUnpin for ParticleState
impl UnwindSafe for ParticleState
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