Skip to content

Sopiro/Physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2D Rigidbody Physics Engine

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

Samples

example1 example2
example3 example4

Features

  • 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

References