The flags are pixi.js's children, texture and textureSource, plus geometry and
material for meshes. Each defaults to false, since children, geometries, materials and
textures are often shared. true sets every flag, so it also destroys resources other nodes
still use. A node passes the same options to the children it destroys.
texture frees the textures of the materials the call destroys, so on a Mesh3D,
texture alone frees nothing and material alone keeps the textures. On a Sprite3D,
texture always frees the sprite's texture. textureSource also frees the sources behind those
textures and, as in pixi.js, does nothing alone.
What a node made for itself always goes, whatever the flags: a View3D's GPU resources,
a BatchedMesh3D's batch, the material a Sprite3D built for its texture.
Example
sprite.destroy({ texture: true }); // the sprite, the material it built, its texture mesh.destroy({ geometry: true, material: true }); // keeps the material's textures model.destroy(true); // everything it can reach, shared or not
What a 3D node's
destroy()takes down with itThe flags are pixi.js's
children,textureandtextureSource, plusgeometryandmaterialfor meshes. Each defaults tofalse, since children, geometries, materials and textures are often shared.truesets every flag, so it also destroys resources other nodes still use. A node passes the same options to the children it destroys.texturefrees the textures of the materials the call destroys, so on a Mesh3D,texturealone frees nothing andmaterialalone keeps the textures. On a Sprite3D,texturealways frees the sprite's texture.textureSourcealso frees the sources behind those textures and, as in pixi.js, does nothing alone.What a node made for itself always goes, whatever the flags: a View3D's GPU resources, a BatchedMesh3D's batch, the material a Sprite3D built for its texture.