ParticleCurve class
A scalar value that changes over a particle's lifetime.
The curve is baked into a small lookup table when constructed, so evaluating it for thousands of particles per frame costs only an array read and one interpolation, no matter how expensive the source function is.
Constructors
- ParticleCurve(double from, double to, {Curve curve = Curves.linear})
-
Interpolates from
fromat spawn totoat death, optionally shaped by an animationcurve(for example Curves.easeOut). - ParticleCurve.constant(double value)
-
Keeps the same
valueover the whole lifetime. - ParticleCurve.custom(double f(double t))
-
Bakes an arbitrary function of the life progress
t, wheretgoes from 0 at spawn to 1 at death.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transform(
double t) → double -
Evaluates the curve at life progress
t, which is clamped to 0...1.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited