pub struct ParticleSettings3D {Show 19 fields
pub rate: f32,
pub burst: usize,
pub duration: f32,
pub looping: bool,
pub lifetime: (f32, f32),
pub speed: (f32, f32),
pub shape: ParticleShape3D,
pub gravity: Vec3,
pub drag: f32,
pub size: (f32, f32),
pub rotation: (f32, f32),
pub size_over_life: ParticleCurve,
pub color_over_life: ParticleGradient,
pub texture: Option<Texture>,
pub sheet: (u32, u32),
pub blend: ParticleBlend3D,
pub max_particles: usize,
pub space: ParticleSpace3D,
pub seed: u64,
}Expand description
Settings copied into an emitter. Change settings by creating a new emitter.
All numeric inputs must be finite; ranges must be ordered and nonnegative
(rotation may be negative). Invalid settings panic in ParticleEmitter3D::new.
use ponko::*;
let settings = ParticleSettings3D { rate: 40.0, blend: ParticleBlend3D::Additive, ..Default::default() };
let emitter = ParticleEmitter3D::new(settings);
assert_eq!(emitter.live_count(), 0);Fields§
§rate: f32Continuous particles per second. Zero emits only bursts.
burst: usizeInitial burst, emitted on the first frame (also for non-looping emitters).
duration: f32Seconds of continuous emission before stopping or looping.
looping: boolRepeat continuous emission after duration; initial burst does not repeat.
lifetime: (f32, f32)Particle lifetime in seconds, minimum strictly positive.
speed: (f32, f32)Initial speed in units per second.
shape: ParticleShape3DSpawn shape in emitter coordinates.
gravity: Vec3Acceleration in simulation coordinates.
drag: f32Exponential velocity damping per second.
size: (f32, f32)Initial billboard width and height in world units (before local scale).
rotation: (f32, f32)Initial rotation around the billboard normal, in radians.
size_over_life: ParticleCurveSize multiplier over normalized lifetime.
color_over_life: ParticleGradientRGBA tint over normalized lifetime.
texture: Option<Texture>Optional image; absent uses white.
sheet: (u32, u32)Sprite sheet (columns, rows); frames advance row-major over lifetime.
blend: ParticleBlend3DHow billboards combine with the scene.
max_particles: usizeHard live-particle limit. Storage is allocated when the emitter is made.
space: ParticleSpace3DWorld or entity coordinates.
seed: u64Independent RNG seed; equal seeds and frame steps give equal simulation.
Trait Implementations§
Source§impl Clone for ParticleSettings3D
impl Clone for ParticleSettings3D
Source§impl Debug for ParticleSettings3D
impl Debug for ParticleSettings3D
Auto Trait Implementations§
impl Forget for ParticleSettings3D
impl Freeze for ParticleSettings3D
impl RefUnwindSafe for ParticleSettings3D
impl Send for ParticleSettings3D
impl Sync for ParticleSettings3D
impl Unpin for ParticleSettings3D
impl UnsafeUnpin for ParticleSettings3D
impl UnwindSafe for ParticleSettings3D
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Component for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
impl<T> MaybeSync for T
impl<T> MaybeSync for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> SerializableAny for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.