mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-07 08:53:25 +01:00
24 lines
411 B
JavaScript
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);
|
|
}
|
|
}
|
|
|
|
|