Class ParticleEmissionConfiguration

java.lang.Object
technology.sola.engine.physics.component.particle.ParticleConfiguration
technology.sola.engine.physics.component.particle.ParticleEmissionConfiguration

@NullMarked public class ParticleEmissionConfiguration extends ParticleConfiguration
ParticleEmissionConfiguration contains configuration for the emission properties for emitting Particles.
  • Method Details

    • shape

      public ParticleEmitterShape shape()
      Returns:
      the ParticleEmitterShape for this emitter. Defaults to CircleEmitterShape
    • setShape

      Updates the ParticleEmitterShape for this emitter.
      Parameters:
      shape - the new shape
      Returns:
      this
    • minLife

      public float minLife()
      Returns:
      the minimum lifespan for newly emitted Particles
    • maxLife

      public float maxLife()
      Returns:
      the maximum lifespan for newly emitted Particles
    • setLifeBounds

      public ParticleEmissionConfiguration setLifeBounds(float minLife, float maxLife)
      Updates the minimum and maximum lifespans for newly emitted Particles.
      Parameters:
      minLife - the minimum lifespan for a new particle
      maxLife - the maximum lifespan for a new particle
      Returns:
      this
    • setLife

      public ParticleEmissionConfiguration setLife(float life)
      Updates the lifespan for newly emitted Particles to be a fixed value.
      Parameters:
      life - the lifespan for new particles
      Returns:
      this
    • interval

      public float interval()
      Returns:
      the interval between each particle emission in seconds
    • setInterval

      public ParticleEmissionConfiguration setInterval(float interval)
      Updates the interval between each particle emission.
      Parameters:
      interval - the new particle emission interval (in seconds)
      Returns:
      this
    • countPerEmit

      public int countPerEmit()
      Returns:
      the number of particles to emit per emission
    • setCountPerEmit

      public ParticleEmissionConfiguration setCountPerEmit(int countPerEmit)
      Updates the number of particles to emit per emission.
      Parameters:
      countPerEmit - the new number of particles to emit
      Returns:
      this
    • cycles

      public @Nullable Integer cycles()
      Returns:
      the number of emission cycles before this emitter turns off.
    • setCycles

      public ParticleEmissionConfiguration setCycles(@Nullable Integer cycles)
      Updates the number of emission cycles before this emitter turns off. Set cycles to null to emit particles continuously.
      Parameters:
      cycles - the number of emission cycles before this emitter turns off.
      Returns:
      this