跳转到内容

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.

new ParticleAPI(module, registry): ParticleAPI

Defined in: particle/ParticleAPI.ts:22

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).

CppRegistry

ParticleAPI

getAliveCount(entity): number

Defined in: particle/ParticleAPI.ts:43

number

number


play(entity): void

Defined in: particle/ParticleAPI.ts:31

number

void


reset(entity): void

Defined in: particle/ParticleAPI.ts:39

number

void


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.

number

Float32Array<ArrayBufferLike> | null

void


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.

number

Float32Array<ArrayBufferLike> | null

void


stop(entity): void

Defined in: particle/ParticleAPI.ts:35

number

void


update(dt): void

Defined in: particle/ParticleAPI.ts:27

number

void