p2-es is a JavaScript 2D rigid body physics engine
p2-es is a 2D rigid body physics engine written in JavaScript. Features include:
- Collision detection
- Contacts
- Friction and restitution
- Motors
- Springs
- Advanced constraints
- Gravity
- Body sleeping
- Various shape types
- Events
This is a maintained fork of p2.js, originally created by Stefan Hedman @schteppe. It is a type-safe flatbundle (esm and cjs) which allows for tree shaking and usage in modern environments.
Examples
Examples showing how to use p2-es with your favorite renderer.
Demos
These demos use the p2 Demo framework, which provides rendering and interactivity.
- Buoyancy
- Car
- CCD
- Circle container
- Collision tests
- Compound objects
- Concave objects
- Constraints
- Control
- DistanceConstraint
- Fixed rotation
- Fixed XY
- Friction
- Gear constraint
- Has active bodies
- Heightfield
- Island solver
- Kinematic body
- Lock constraint
- Piston
- Prismatic constraint
- Ragdoll
- Sensor
- Restitution
- Segway
- Sleep
- Soft wheel
- Springs
- Surface velocity
- Suspension
- Tearable constraints
- TopDownVehicle
- Voronoi