You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type property of the Cylinder is now equal to Shape.types.CYLINDER. #59
Body.applyImpulse() and Body.applyForce() are now relative to the center of the body instead of the center of the world 86b0444
Sleeping bodies now wake up if a force or an impulse is applied to them #61
Added a property World.hasActiveBodies: boolean which will be false when all physics bodies are sleeping. This allows for invalidating frames when physics aren't active for increased performance.
Added optional property World.frictionGravity: Vec3 which can be set to customize the force used when computing the friction between two colliding bodies. If undefined, World.gravity will be used. This property is useful to enable friction in zero gravity. This addresses issue #224 and follows the pattern established for p2.js.
If instead you're using three.js in a React environment with react-three-fiber, check out use-cannon! It's a wrapper around cannon-es.
Installation
yarn add cannon-es
Usage
import{World}from'cannon-es'// ...
or, if you're using webpack, you can import it like this while still taking advantage of tree shaking: