borrow bucket map from cam slicer to allow negative z indices

This commit is contained in:
Stewart Allen 2023-01-08 20:33:13 -05:00
commit 5a56453390
2 changed files with 16 additions and 6 deletions

View file

@ -22,6 +22,14 @@ THREE.computeFaceNormal = function(vA,vB,vC) {
return cb;
};
// https://www.npmjs.com/package/three-mesh-bvh
THREE.addBVH = function() {
const { computeBoundsTree, disposeBoundsTree, acceleratedRaycast } = MeshBVHLib;
THREE.BufferGeometry.prototype.computeBoundsTree = computeBoundsTree;
THREE.BufferGeometry.prototype.disposeBoundsTree = disposeBoundsTree;
THREE.Mesh.prototype.raycast = acceleratedRaycast;
};
THREE.dispose = function(obj) {
if (!obj) {
return;