pub struct Particle {
pub x: f32,
pub y: f32,
pub vx: f32,
pub vy: f32,
pub lifetime: f32,
pub initial_lifetime: f32,
pub size: f32,
pub color: u32,
pub active: bool,
}Expand description
A single particle in the particle system.
Fields§
§x: f32X position
y: f32Y position
vx: f32X velocity
vy: f32Y velocity
lifetime: f32Lifetime remaining in seconds
initial_lifetime: f32Initial lifetime (for alpha calculation)
size: f32Particle size (radius)
color: u32Color RGB (packed as u32: 0xRRGGBB)
active: boolWhether this particle is active
Implementations§
Trait Implementations§
impl Copy for Particle
Auto Trait Implementations§
impl Freeze for Particle
impl RefUnwindSafe for Particle
impl Send for Particle
impl Sync for Particle
impl Unpin for Particle
impl UnwindSafe for Particle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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