2D Rigid body physics engine written in TypeScript.
Live demo: https://sopiro.github.io/Physics/
Video: https://youtu.be/ROAqjE40pxU
- 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 callback
- Constraint-basd simulation
- Contact constraint
- Joints: Revolute, Prismatic, Distance, Max distance, Weld, Motor, Line, Angle, Grab
- Soft constraints
- Block solver
- Optimization
- Constraint islanding
- Island(Rigid body) sleeping