Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

INACTIVE - Convert a THREE.Mesh to a CANNON.Shape.

Notifications You must be signed in to change notification settings

MozillaReality/three-to-cannon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

three-to-cannon

Build Status

Convert a THREE.Mesh to a CANNON.Shape, and optional optimizations with simplified shapes.

Usage

npm install --save three-to-cannon
mesh2shape = require('three-to-cannon');

// Automatic.
var shape = mesh2shape(object3D);

// Bounding box (AABB).
var shape = mesh2shape(object3D, {type: mesh2shape.Type.BOX});

// Bounding sphere.
var shape = mesh2shape(object3D, {type: mesh2shape.Type.SPHERE});

// Cylinder.
var shape = mesh2shape(object3D, {type: mesh2shape.Type.CYLINDER});

// Convex hull.
var shape = mesh2shape(object3D, {type: mesh2shape.Type.HULL});

// Mesh (not recommended).
var shape = mesh2shape(object3D, {type: mesh2shape.Type.MESH});

About

INACTIVE - Convert a THREE.Mesh to a CANNON.Shape.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%