import { ColorGenerator, FunctionColorGenerator, FunctionJSON, FunctionValueGenerator, ValueGenerator, Behavior, Particle, EmitterShape, ShapeJSON, RendererEmitterSettings, RotationGenerator, IParticleSystem, EmissionState, SerializationOptions, Matrix4, Vector3Generator, ParticleSystemEvent, ParticleSystemEventType } from 'quarks.core'; import { MetaData, ParticleEmitter } from './ParticleEmitter'; import { Object3DEventMap, Blending, BufferGeometry, Layers, Texture, Material } from 'three'; import { RenderMode } from './VFXBatch'; import { BatchedRenderer, VFXBatchSettings } from './BatchedRenderer'; import { ThreeMetaData } from './util/ThreeUtil'; export interface BurstParameters { time: number; count: ValueGenerator | FunctionValueGenerator; cycle: number; interval: number; probability: number; } export interface BurstParametersJSON { time: number; count: FunctionJSON | number; cycle: number; interval: number; probability: number; } export interface ParticleSystemParameters { autoDestroy?: boolean; looping?: boolean; prewarm?: boolean; duration?: number; shape?: EmitterShape; startLife?: ValueGenerator | FunctionValueGenerator; startSpeed?: ValueGenerator | FunctionValueGenerator; startRotation?: ValueGenerator | FunctionValueGenerator | RotationGenerator; startSize?: ValueGenerator | FunctionValueGenerator | Vector3Generator; startLength?: ValueGenerator | FunctionValueGenerator; startColor?: ColorGenerator | FunctionColorGenerator; emissionOverTime?: ValueGenerator | FunctionValueGenerator; emissionOverDistance?: ValueGenerator | FunctionValueGenerator; emissionBursts?: Array; onlyUsedByOther?: boolean; behaviors?: Array; instancingGeometry?: BufferGeometry; renderMode?: RenderMode; rendererEmitterSettings?: RendererEmitterSettings; speedFactor?: number; material: Material; layers?: Layers; startTileIndex?: ValueGenerator; uTileCount?: number; vTileCount?: number; blendTiles?: boolean; softParticles?: boolean; softFarFade?: number; softNearFade?: number; renderOrder?: number; worldSpace?: boolean; } export interface ParticleSystemJSONParameters { version: string; autoDestroy: boolean; looping: boolean; prewarm: boolean; duration: number; shape: ShapeJSON; startLife: FunctionJSON; startSpeed: FunctionJSON; startRotation: FunctionJSON; startSize: FunctionJSON; startColor: FunctionJSON; emissionOverTime: FunctionJSON; emissionOverDistance: FunctionJSON; emissionBursts?: Array; onlyUsedByOther: boolean; rendererEmitterSettings: RendererEmitterSettings; instancingGeometry?: any; renderMode: number; renderOrder?: number; speedFactor?: number; texture?: string; material: string; layers?: number; startTileIndex: FunctionJSON | number; uTileCount: number; vTileCount: number; blendTiles?: boolean; softParticles?: boolean; softFarFade?: number; softNearFade?: number; blending?: Blending; transparent?: boolean; behaviors: Array; worldSpace: boolean; } export declare class ParticleSystem implements IParticleSystem { autoDestroy: boolean; prewarm: boolean; looping: boolean; duration: number; startLife: ValueGenerator | FunctionValueGenerator; startSpeed: ValueGenerator | FunctionValueGenerator; startRotation: ValueGenerator | FunctionValueGenerator | RotationGenerator; startSize: ValueGenerator | FunctionValueGenerator | Vector3Generator; startColor: ColorGenerator | FunctionColorGenerator; startTileIndex: ValueGenerator; rendererEmitterSettings: RendererEmitterSettings; emissionOverTime: ValueGenerator | FunctionValueGenerator; emissionOverDistance: ValueGenerator | FunctionValueGenerator; emissionBursts: Array; onlyUsedByOther: boolean; worldSpace: boolean; particleNum: number; paused: boolean; particles: Array; emitterShape: EmitterShape; emitter: ParticleEmitter; rendererSettings: VFXBatchSettings; neededToUpdateRender: boolean; behaviors: Array; emissionState: EmissionState; private prewarmed; private emitEnded; private markForDestroy; private previousWorldPos?; private temp; private travelDistance; private normalMatrix; private memory; private listeners; _renderer?: BatchedRenderer; set time(time: number); get time(): number; get layers(): Layers; get texture(): Texture | null; set texture(texture: Texture | null); get material(): Material; set material(material: Material); get uTileCount(): number; set uTileCount(u: number); get vTileCount(): number; set vTileCount(v: number); get blendTiles(): boolean; set blendTiles(v: boolean); get softParticles(): boolean; set softParticles(v: boolean); get softNearFade(): number; set softNearFade(v: number); get softFarFade(): number; set softFarFade(v: number); get instancingGeometry(): BufferGeometry; set instancingGeometry(geometry: BufferGeometry); get renderMode(): RenderMode; set renderMode(renderMode: RenderMode); get renderOrder(): number; set renderOrder(renderOrder: number); get blending(): Blending; set blending(blending: Blending); constructor(parameters: ParticleSystemParameters); pause(): void; play(): void; stop(): void; private spawn; endEmit(): void; dispose(): void; restart(): void; private firstTimeUpdate; private update; emit(delta: number, emissionState: EmissionState, emitterMatrix: Matrix4): void; toJSON(meta: MetaData, options?: SerializationOptions): ParticleSystemJSONParameters; static fromJSON(json: ParticleSystemJSONParameters, meta: ThreeMetaData, dependencies: { [uuid: string]: Behavior; }): ParticleSystem; addBehavior(behavior: Behavior): void; getRendererSettings(): VFXBatchSettings; addEventListener(event: ParticleSystemEventType, callback: (event: ParticleSystemEvent) => void): void; removeAllEventListeners(event: ParticleSystemEventType): void; removeEventListener(event: ParticleSystemEventType, callback: (event: ParticleSystemEvent) => void): void; private fire; clone(): ParticleSystem; }