import { Color , Rect , Vector } from "../../components" ; import { SourceSampler , rectSource } from "../../systems/sources" ; import { Variation } from "../../systems/variation" ; /**
 * Holds a set of options used to configure the way particles are emitted in.
 */ export interface EmissionOptions { defaultValue rate : number ; defaultValue bursts : Burst [ ] ; defaultValue sourceSampler : SourceSampler ; defaultValue angle : Variation < number > ; defaultValue initialLifetime : Variation < number > ; defaultValue initialSpeed : Variation < number > ; defaultValue initialSize : Variation < number > ; defaultValue initialRotation : Variation < Vector > ; defaultValue initialColor : Variation < Color > ; } /**
 * Represents a burst of emitted particles.
 */ export interface Burst { /**
     * The time to perform the burst at. This must be less than the duration of the emitter.
     */ time : number ; /**
     * The variable number of particles that should be emitted.
     */ count : Variation < number > ; /**
     * The (optional) likelihood that the burst will activate, from 0 (never) to 1 (always).
     */ probability ? : number ; } /**
 * Returns the default set of emission options.
 */ export function getDefaultEmissionOptions ( ) { return { rate : 10 , angle : 0 , bursts : [ ] , sourceSampler : rectSource ( Rect . zero ) , initialLifetime : 5 , initialSpeed : 5 , initialSize : 1 , initialRotation : Vector . zero , initialColor : Color . white , } ; }