ParticleCurve.custom constructor

ParticleCurve.custom(
  1. double f(
    1. double t
    )
)

Bakes an arbitrary function of the life progress t, where t goes from 0 at spawn to 1 at death.

Implementation

ParticleCurve.custom(double Function(double t) f)
  : _samples = Float32List(_resolution + 1) {
  for (var i = 0; i <= _resolution; i++) {
    _samples[i] = f(i / _resolution);
  }
}