use stock/tool bounding boxes to optimize animation. stock slices dynamic based on preference

This commit is contained in:
Stewart Allen 2022-11-12 12:08:43 -05:00
commit 3b3d3e5a08
2 changed files with 15 additions and 11 deletions

View file

@ -67,6 +67,13 @@ const CSG = {
triVerts: index.toUint32()
});
return mesh;
},
toBox3(mesh) {
const { min, max } = mesh._boundingBox();
const vmin = new THREE.Vector3(min.x, min.y, min.z);
const vmax = new THREE.Vector3(max.x, max.y, max.z);
return new THREE.Box3(vmin, vmax);
}
};