Skip to content

copper3d / Modules / Utils/dispose

Module: Utils/dispose

Table of contents

Interfaces

Functions

Functions

disposeMaterial

disposeMaterial(material): void

Material.dispose() does NOT cascade into its textures, so a canvas-backed or image-backed map stays on the GPU without this. Handles the array form too: a multi-material mesh would otherwise reach Array.prototype.dispose, which does not exist.

Parameters

NameType
materialundefined | null | DisposableMaterial | DisposableMaterial[]

Returns

void

Defined in

src/Utils/dispose.ts:60


disposeObject3D

disposeObject3D(root): void

Works on a lone mesh as well as on a whole subtree -- traverse visits the root itself -- so a slice plane that was never added to a scene is freed by the same call.

Parameters

NameType
rootDisposableObject3D

Returns

void

Defined in

src/Utils/dispose.ts:77