Struct EmitterConfig

Source
pub struct EmitterConfig {
Show 30 fields pub local_coords: bool, pub emission_shape: EmissionShape, pub one_shot: bool, pub lifetime: f32, pub lifetime_randomness: f32, pub explosiveness: f32, pub amount: u32, pub shape: ParticleShape, pub emitting: bool, pub initial_direction: Vec2, pub initial_direction_spread: f32, pub initial_velocity: f32, pub initial_velocity_randomness: f32, pub linear_accel: f32, pub initial_rotation: f32, pub initial_rotation_randomness: f32, pub initial_angular_velocity: f32, pub initial_angular_velocity_randomness: f32, pub angular_accel: f32, pub angular_damping: f32, pub size: f32, pub size_randomness: f32, pub size_curve: Option<Curve>, pub blend_mode: BlendMode, pub colors_curve: ColorCurve, pub gravity: Vec2, pub texture: Option<Texture2D>, pub atlas: Option<AtlasConfig>, pub material: Option<ParticleMaterial>, pub post_processing: Option<PostProcessing>,
}

Fields§

§local_coords: bool

If false - particles spawns at position supplied to .draw(), but afterwards lives in current camera coordinate system. If false particles use coordinate system originated to the emitter draw position

§emission_shape: EmissionShape

Particles will be emitted inside that region.

§one_shot: bool

If true only one emission cycle occurs. May be re-emitted by .emit() call.

§lifetime: f32

Lifespan of individual particle.

§lifetime_randomness: f32

Particle lifetime randomness ratio. Each particle will spawned with “lifetime = lifetime - lifetime * rand::gen_range(0.0, lifetime_randomness)”.

§explosiveness: f32

0..1 value, how rapidly particles in emission cycle are emitted. With 0 particles will be emitted with equal gap. With 1 all the particles will be emitted at the beginning of the cycle.

§amount: u32

Amount of particles emitted in one emission cycle.

§shape: ParticleShape

Shape of each individual particle mesh.

§emitting: bool

Particles are emitting when “emitting” is true. If its a “one-shot” emitter, emitting will switch to false after active emission cycle.

§initial_direction: Vec2

Unit vector specifying emission direction.

§initial_direction_spread: f32

Angle from 0 to “2 * Pi” for random fluctuation for direction vector.

§initial_velocity: f32

Initial speed for each emitted particle. Direction of the initial speed vector is affected by “direction” and “spread”

§initial_velocity_randomness: f32

Initial velocity randomness ratio. Each particle will spawned with “initial_velocity = initial_velocity - initial_velocity * rand::gen_range(0.0, initial_velocity_randomness)”.

§linear_accel: f32

Velocity acceleration applied to each particle in the direction of motion.

§initial_rotation: f32§initial_rotation_randomness: f32

Initial rotation randomness. Each particle will spawned with “initial_rotation = initial_rotation - initial_rotation * rand::gen_range(0.0, initial_rotation_randomness)”

§initial_angular_velocity: f32§initial_angular_velocity_randomness: f32

Initial angular velocity randomness. Each particle will spawned with “initial_angular_velocity = initial_angular_velocity - initial_angular_velocity * rand::gen_range(0.0, initial_angular_velocity_randomness)”.

§angular_accel: f32

Angular velocity acceleration applied to each particle .’

§angular_damping: f32

Angluar velocity damping Each frame angular velocity will be transformed “angular_velocity *= (1.0 - angular_damping)”.

§size: f32

Each particle is a “size x size” square.

§size_randomness: f32

Each particle will spawned with “size = size - size * rand::gen_range(0.0, size_randomness)”.

§size_curve: Option<Curve>

If curve is present in each moment of particle lifetime size would be multiplied by the value from the curve

§blend_mode: BlendMode

Particles rendering mode.

§colors_curve: ColorCurve

How particles should change base color along the lifetime.

§gravity: Vec2

Gravity applied to each individual particle.

§texture: Option<Texture2D>

Particle texture. If none particles going to be white squares.

§atlas: Option<AtlasConfig>

For animated texture specify spritesheet layout. If none the whole texture will be used.

§material: Option<ParticleMaterial>

Custom material used to shade each particle.

§post_processing: Option<PostProcessing>

If none particles will be rendered directly to the screen. If not none all the particles will be rendered to a rectangle and than this rectangle will be rendered to the screen. This will allows some effects affecting particles as a whole. NOTE: this is not really implemented and now Some will just make hardcoded downscaling

Trait Implementations§

Source§

impl Clone for EmitterConfig

Source§

fn clone(&self) -> EmitterConfig

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EmitterConfig

Source§

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

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

impl Default for EmitterConfig

Source§

fn default() -> EmitterConfig

Returns the “default value” for a type. Read more

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.