jsketcher/modules/scene/sceneGraph.js
2018-02-18 22:09:13 -08:00

24 lines
411 B
JavaScript

export function addToGroup(group, child) {
group.add(child);
}
export function removeFromGroup(group, child) {
group.remove(child);
}
export function createGroup() {
return new THREE.Object3D();
}
export function clearGroup(group) {
while (group.children.length) {
const o = group.children[0];
clearGroup(o);
o.material.dispose();
o.geometry.dispose();
group.remove(o);
}
}