Recursively dispose obj and every descendant, removing each child
from its parent as it walks. Disposes geometry and material(s) on
Mesh and InstancedMesh instances; non-renderable Object3Ds
(Group / Object3D / Light) are walked through but contribute
nothing to dispose themselves.
The walk is depth-first by always disposing children[0] until the
children array is empty — the same shape clearSceneContent had
inline. This avoids re-indexing after each removal.
Recursively dispose
objand every descendant, removing each child from its parent as it walks. Disposes geometry and material(s) onMeshandInstancedMeshinstances; non-renderable Object3Ds (Group / Object3D / Light) are walked through but contribute nothing to dispose themselves.The walk is depth-first by always disposing
children[0]until the children array is empty — the same shapeclearSceneContenthad inline. This avoids re-indexing after each removal.