Skip to main content

ParticleSystem

Struct ParticleSystem 

Source
pub struct ParticleSystem {
Show 29 fields pub instanced: bool, pub instances: u32, pub max_particles: u32, pub material: Option<String>, pub rate: f32, pub rate_change: f32, pub rate_scale: f32, pub duration: i64, pub direction: [f32; 3], pub spawn_size: f32, pub spawn_box: [f32; 3], pub cone: [f32; 2], pub speed: [f32; 2], pub force_scale: f32, pub damping: f32, pub rotation: [f32; 2], pub spin: [f32; 2], pub spin_change: f32, pub spin_damping: f32, pub life: [f32; 2], pub force_amount: f32, pub force: [f32; 3], pub size: [f32; 2], pub growth: f32, pub growth_damping: f32, pub colors: [u32; 2], pub color_span: [f32; 2], pub fade_in: i64, pub fade_out: i64,
}
Expand description

A particle system: an emitter of quads that face the camera (smoke, fire, dust, snow). Times are in microseconds. See docs/PARTICLES.md.

Original: Graphics::ParticleSystem::Serialize, Runtime 0x1800a5c70, after the Graphics::Particle block.

Original: Runtime 0x180106790.

Fields§

§instanced: bool

Particle: whether it is instanced.

§instances: u32

Particle: the shared instance count.

§max_particles: u32

Particle: the most particles alive.

§material: Option<String>

Particle: the MaterialInstance.

§rate: f32

Particles per second.

§rate_change: f32

The change of the rate per second squared, multiplied by rate_scale.

§rate_scale: f32

The factor of rate_change.

§duration: i64

How long it emits (0 for ever).

§direction: [f32; 3]

The emission direction (model space).

§spawn_size: f32

The spawn box’s size: each axis spans ± axis × size / 2.

§spawn_box: [f32; 3]

The spawn box’s axes.

§cone: [f32; 2]

The emission cone’s angles (degrees).

§speed: [f32; 2]

Speed (base, ± range).

§force_scale: f32

How strongly the force acts.

§damping: f32

The share of the velocity kept at each update.

§rotation: [f32; 2]

Rotation (degrees, base ± range).

§spin: [f32; 2]

Spin (degrees/s, base ± range, either way).

§spin_change: f32

The change of the spin.

§spin_damping: f32

The share of the spin kept at each update.

§life: [f32; 2]

Life (seconds, base ± range).

§force_amount: f32

The strength of the force.

§force: [f32; 3]

The force’s direction (for example the wind).

§size: [f32; 2]

The size (base ± range).

§growth: f32

How fast the size grows.

§growth_damping: f32

The share of the growth kept at each update.

§colors: [u32; 2]

Start and end colours (BGRA bytes).

§color_span: [f32; 2]

The part of life the colour moves over.

§fade_in: i64

How long it fades in.

§fade_out: i64

How long it fades out.

Trait Implementations§

Source§

impl Clone for ParticleSystem

Source§

fn clone(&self) -> ParticleSystem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParticleSystem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ParticleSystem

Source§

fn eq(&self, other: &ParticleSystem) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ParticleSystem

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.