three-to-cannon
Convert a THREE.Mesh to a CANNON.Shape, and optional optimizations with simplified shapes.
Usage
Installation:
npm install --save three-to-cannon
Import:
import { threeToCannon } from 'three-to-cannon';
threeToCannon = require('three-to-cannon').threeToCannon;
Use:
const shape = threeToCannon(object3D);
const shape = threeToCannon(object3D, {type: threeToCannon.Type.BOX});
const shape = threeToCannon(object3D, {type: threeToCannon.Type.SPHERE});
const shape = threeToCannon(object3D, {type: threeToCannon.Type.CYLINDER});
const shape = threeToCannon(object3D, {type: threeToCannon.Type.HULL});
const shape = threeToCannon(object3D, {type: threeToCannon.Type.MESH});