import Vector3 from '../math/Vector3'; import Particle from './Particle'; import * as Value from '../math/Value'; interface ParticleEmitterOpts { /** * Maximum number of particles created by this emitter */ max: number; /** * Number of particles created by this emitter each shot */ amount: number; /** * Particle life generator */ life?: Value.Value; /** * Particle position generator */ position?: Value.Value; /** * Particle rotation generator */ rotation?: Value.Value; /** * Particle velocity generator */ velocity?: Value.Value; /** * Particle angular velocity generator */ angularVelocity?: Value.Value; /** * Particle sprite size generator */ spriteSize?: Value.Value; /** * Particle weight generator */ weight?: Value.Value; } interface ParticleEmitter extends ParticleEmitterOpts { } declare class ParticleEmitter { /** @lends clay.particle.Emitter# */ /** * Maximum number of particles created by this emitter * @type {number} */ max: number; amount: number; _particlePool: Particle[]; constructor(opts?: Partial); /** * Emitter number of particles and push them to a given particle list. Emmit number is defined by amount property */ emit(out: Particle[]): void; /** * Kill a dead particle and put it back in the pool */ kill(particle: Particle): void; /** * Create a constant 1d value generator. Alias for {@link clay.Value.constant} * @function clay.particle.Emitter.constant */ static constant: typeof Value.constant; /** * Create a constant vector value(2d or 3d) generator. Alias for {@link clay.Value.vector} */ static vector: typeof Value.vector; /** * Create a random 1d value generator. Alias for {@link clay.Value.random1D} */ static random1D: typeof Value.random1D; /** * Create a random 2d value generator. Alias for {@link clay.Value.random2D} */ static random2D: typeof Value.random2D; /** * Create a random 3d value generator. Alias for {@link clay.Value.random3D} */ static random3D: typeof Value.random3D; } export default ParticleEmitter;