initParticle method

  1. @override
void initParticle(
  1. Particle p
)
override

Implementation

@override
void initParticle(Particle p) {
  initPosition(p);
  initRadius(p);

  final double deltaSpeed = (options.spawnMaxSpeed - options.spawnMinSpeed);
  double speed = random.nextDouble() * deltaSpeed + options.spawnMinSpeed;
  initDirection(p, speed);

  final double deltaOpacity = (options.maxOpacity - options.minOpacity);
  p.alpha = options.spawnOpacity;
  p.targetAlpha = random.nextDouble() * deltaOpacity + options.minOpacity;
}