三目BVH
一个BVH实现,可以加快光线投射的速度,并启用three.js网格的相交测试。
以60帧/秒的速度向80,000个多边形模型投射500条光线!
用
使用预制函数
// Import via ES6 modules
import * as THREE from 'three' ;
import { computeBoundsTree , disposeBoundsTree , acceleratedRaycast } from 'three-mesh-bvh' ;
// Or UMD
const { computeBoundsTree , disposeBoundsTree , acceleratedRaycast } = window . MeshBVHLib ;
// Add the extension functions
THREE . BufferGeometry .
1