playcanvas
Version:
PlayCanvas WebGL game engine
140 lines (139 loc) • 4.53 kB
TypeScript
export class ParticleEmitter {
constructor(graphicsDevice: any, options: any);
/** @type {ParticleMaterial|null} */
material: ParticleMaterial | null;
/** @type {Texture|null} */
internalTex0: Texture | null;
/** @type {Texture|null} */
internalTex1: Texture | null;
/** @type {Texture|null} */
internalTex2: Texture | null;
/** @type {Texture|null} */
colorParam: Texture | null;
graphicsDevice: any;
precision: number;
_addTimeTime: number;
numParticles: any;
_gpuUpdater: ParticleGPUUpdater;
_cpuUpdater: ParticleCPUUpdater;
emitterPosUniform: Float32Array<ArrayBuffer>;
wrapBoundsUniform: Float32Array<ArrayBuffer>;
emitterScaleUniform: Float32Array<ArrayBuffer>;
animTilesParams: Float32Array<ArrayBuffer>;
animParams: Float32Array<ArrayBuffer>;
animIndexParams: Float32Array<ArrayBuffer>;
vbToSort: any[];
vbOld: Float32Array<ArrayBuffer>;
particleDistance: Float32Array<any>;
camera: any;
swapTex: boolean;
useMesh: boolean;
useCpu: boolean;
pack8: boolean;
localBounds: BoundingBox;
worldBoundsNoTrail: BoundingBox;
worldBoundsTrail: BoundingBox[];
worldBounds: BoundingBox;
worldBoundsSize: Vec3;
prevWorldBoundsSize: Vec3;
prevWorldBoundsCenter: Vec3;
prevEmitterExtents: any;
prevEmitterRadius: any;
worldBoundsMul: Vec3;
worldBoundsAdd: Vec3;
timeToSwitchBounds: number;
shaderParticleUpdateRespawn: import("../../index.js").Shader;
shaderParticleUpdateNoRespawn: import("../../index.js").Shader;
shaderParticleUpdateOnStop: import("../../index.js").Shader;
numParticleVerts: number;
numParticleIndices: number;
meshInstance: MeshInstance;
drawOrder: number;
seed: number;
fixedTimeStep: number;
maxSubSteps: number;
simTime: number;
simTimeTotal: number;
beenReset: boolean;
_layer: any;
get defaultParamTexture(): any;
onChangeCamera(): void;
calculateBoundsMad(): void;
calculateWorldBounds(): void;
resetWorldBounds(): void;
calculateLocalBounds(): void;
rebuild(): void;
colorMap: any;
spawnBounds: any;
numParticlesPot: number;
particleTex: Float32Array<ArrayBuffer>;
particleTexStart: any;
particleTexIN: Texture;
particleTexOUT: Texture;
rtParticleTexIN: RenderTarget;
rtParticleTexOUT: RenderTarget;
_isAnimated(): any;
rebuildGraphs(): void;
qLocalVelocity: any;
qVelocity: any;
qColor: any;
qRotSpeed: any;
qScale: any;
qAlpha: any;
qRadialSpeed: any;
qLocalVelocity2: any;
qVelocity2: any;
qColor2: any;
qRotSpeed2: any;
qScale2: any;
qAlpha2: any;
qRadialSpeed2: any;
localVelocityUMax: Float32Array<ArrayBuffer>;
velocityUMax: Float32Array<ArrayBuffer>;
colorUMax: Float32Array<ArrayBuffer>;
rotSpeedUMax: number[];
scaleUMax: number[];
alphaUMax: number[];
radialSpeedUMax: number[];
qLocalVelocityDiv: Float32Array<any>;
qVelocityDiv: Float32Array<any>;
qColorDiv: Float32Array<any>;
qRotSpeedDiv: Float32Array<any>;
qScaleDiv: Float32Array<any>;
qAlphaDiv: Float32Array<any>;
qRadialSpeedDiv: Float32Array<any>;
maxVel: number;
internalTex3: Texture;
_setMaterialTextures(): void;
_createMaterial(): ParticleMaterial;
resetMaterial(): void;
_compParticleFaceParams(): void;
getVertexInfo(): {
semantic: string;
components: number;
type: number;
}[];
_allocate(numParticles: any): void;
vertexBuffer: VertexBuffer;
indexBuffer: IndexBuffer;
vbCPU: Float32Array<ArrayBuffer>;
reset(): void;
loop: any;
prewarm(time: any): void;
resetTime(): void;
endTime: number;
finishFrame(): void;
addTime(delta: any, isOnStop: any): void;
_destroyResources(): void;
destroy(): void;
}
import { ParticleMaterial } from './particle-material.js';
import { Texture } from '../../platform/graphics/texture.js';
import { ParticleGPUUpdater } from './gpu-updater.js';
import { ParticleCPUUpdater } from './cpu-updater.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import { Vec3 } from '../../core/math/vec3.js';
import { MeshInstance } from '../mesh-instance.js';
import { RenderTarget } from '../../platform/graphics/render-target.js';
import { VertexBuffer } from '../../platform/graphics/vertex-buffer.js';
import { IndexBuffer } from '../../platform/graphics/index-buffer.js';