Skip to content

animation.createClip#dispose

Summary

animation.createClip#dispose deterministically releases the Wasm allocations whose ownership was transferred to the clip at creation and invalidates its sampling state. The call is idempotent.

After disposal, sample, samplersPtr, and channelsPtr reject access. disposed remains available for checking state.

Syntax

AnimationClip.dispose(): void
clip.dispose();

Parameters

None.

Returns

void

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);

const clip = wgpu.animation.createClip({ name: "clip", samplerCount: 0, channelCount: 0, samplersPtr: 0, channelsPtr: 0, startTime: 0, endTime: 1 });
clip.dispose();
console.log(clip.disposed); // true

See Also