2D Rigid body physics engine written in TypeScript.
Live demo: https://sopiro.github.io/Physics/
Video: https://youtu.be/ROAqjE40pxU
Optimized C++ library: https://github.com/Sopiro/Muli
- Real-time interactive simulation
- Rigid body
- Shapes: Convex polygons and circles
- Density-based body definition
- Collision detection
- Broad phase, narrow phase collision detection
- Dynamic AABB volume tree for spatial partitioning
- Computing minimum distance between two convex shapes (GJK)
- Contact manifold generation (EPA)
- Collision resolution
- Impulse-based collision response
- Friction and restitution
- Iterative solver (Sequential impulses)
- Collision callbacks
- Constraint-based simulation
- Contact constraint
- Joints: Revolute, Prismatic, Distance, Max distance, Weld, Motor, Line, Angle and Grab
- Soft constraints
- 2-contact LCP solver (Block solver)
- Optimization
- Constraint islanding
- Island(Rigid body) sleeping