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
impl Clone for EmitterConfig
Source§fn clone(&self) -> EmitterConfig
fn clone(&self) -> EmitterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more