ParticleAPI
此内容尚不支持你的语言。
Defined in: particle/ParticleAPI.ts:16
Per-app particle API. Wraps the C++ registry-scoped particle system so two App instances (e.g. editor tabs previewing different scenes) can drive independent simulations without cross-talk.
Consumed as a resource: declare Res(Particle) as a system param, or
grab it with app.getResource(Particle) outside ECS code.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ParticleAPI(
module,registry):ParticleAPI
Defined in: particle/ParticleAPI.ts:22
Parameters
Section titled “Parameters”module
Section titled “module”NonNullable<EngineApi>
whichever engine core is present — the wasm module on the web, the native host’s bindings on a device (see ecs/engineApi.ts).
registry
Section titled “registry”Returns
Section titled “Returns”ParticleAPI
Methods
Section titled “Methods”getAliveCount()
Section titled “getAliveCount()”getAliveCount(
entity):number
Defined in: particle/ParticleAPI.ts:43
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”number
play()
Section titled “play()”play(
entity):void
Defined in: particle/ParticleAPI.ts:31
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
reset()
Section titled “reset()”reset(
entity):void
Defined in: particle/ParticleAPI.ts:39
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
setColorLut()
Section titled “setColorLut()”setColorLut(
entity,lut):void
Defined in: particle/ParticleAPI.ts:52
Upload an entity’s baked color-over-life LUT (an N×4 RGBA Float32Array) so the sim samples it instead of start/end + easing; pass null to clear. The data is copied into the wasm heap for the call, then freed.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Float32Array<ArrayBufferLike> | null
Returns
Section titled “Returns”void
setSizeLut()
Section titled “setSizeLut()”setSizeLut(
entity,lut):void
Defined in: particle/ParticleAPI.ts:58
Upload an entity’s baked size-over-life multiplier LUT (an N-scalar Float32Array), or null to clear.
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Float32Array<ArrayBufferLike> | null
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop(
entity):void
Defined in: particle/ParticleAPI.ts:35
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
update()
Section titled “update()”update(
dt):void
Defined in: particle/ParticleAPI.ts:27
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void