三加农炮
将THREE.Mesh转换为CANNON.Shape,并使用简化的形状进行可选的优化。
用法
安装:
npm install -- save three - to - cannon
进口:
// ES6
import { threeToCannon } from 'three-to-cannon' ;
// CommonJS
threeToCannon = require ( 'three-to-cannon' ) . threeToCannon ;
用:
// Automatic.
const shape = threeToCannon ( object3D ) ;
// Bounding box (AABB).
const shape = threeToCannon ( object3D , { type : threeToCannon . Type . BOX
1