A lightweight 3D physics engine written in JavaScript.
Inspired by three.js and ammo.js, and driven by the fact that the web lacks a physics engine, here comes cannon.js. The rigid body physics engine includes simple collision detection, various body shapes, contacts, friction and constraints.
Features:
- Rigid body dynamics
- Discrete collision detection
- Contacts, friction and restitution
-
Constraints
- PointToPoint (a.k.a. ball/socket joint)
- Distance
- Hinge (with optional motor)
- Lock
- ConeTwist
- Gauss-Seidel constraint solver and an island split algorithm
- Collision filters
- Body sleeping
- Experimental SPH / fluid support
- Various shapes and collision algorithms
Demo: http://schteppe.github.io/cannon.js/examples/threejs_fps.html
Download Links
https://github.com/schteppe/cannon.js