https://github.com/jonpena/cirobb
A small ๐ฎ 2D physics engine that explains mechanics โก in physics engines for educational use โจ.
https://github.com/jonpena/cirobb
physics-2d physics-engine physics-simulation rigid-bodies
Last synced: 10 months ago
JSON representation
A small ๐ฎ 2D physics engine that explains mechanics โก in physics engines for educational use โจ.
- Host: GitHub
- URL: https://github.com/jonpena/cirobb
- Owner: jonpena
- License: mit
- Created: 2020-02-18T01:47:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-26T11:14:32.000Z (about 1 year ago)
- Last Synced: 2025-04-06T14:11:59.662Z (11 months ago)
- Topics: physics-2d, physics-engine, physics-simulation, rigid-bodies
- Language: C
- Homepage: https://jonpena.github.io/Cirobb-wasm
- Size: 7.62 MB
- Stars: 59
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cirobb
## ๐ Overview
**Cirobb** is a **2D Rigid Body Physics Engine** inspired by **Box2D Lite** that was created with the purpose of helping people who are starting in this wonderful world of physics for Videogames. The Engine uses the Erin Catto's Contact Persistence Algorithm and it's implementation of the PGS (Projected Gauss Seidel) solver to solve the MLCP very well known as a SI (Sequential Impulse).
Additionally, it features a straightforward 2D Collision Detection system that efficiently calculates Contact Points, Normal Direction, and Penetration depth. This project aims to provide a clear and detailed understanding of how physics engines work under the hood, making it an ideal learning resource for game developers.
> ๐ก For more complex simulations with multiple constraints and shapes, we recommend using **Box2D**, which is considered the best open-source 2D physics engine available.
## ๐ธ Captures


## โก Demos & Examples
- [WebAssembly Demo (v1.1.8)](https://jonpena.github.io/Cirobb-wasm)
- [YouTube Demo Video (v1.1.4)](https://youtu.be/j2p6qmOVA7M)
## ๐ Future Features
โจ Direct Solver
Improve Velocity Solver convergence
๐ Distance Constraint
Optional feature for distance-based constraints
๐ท Convex Polygons
Collision Detection against convex polygons
๐ Contact Points
Change from Distance-Based to Feature-Based
## ๐ Learning Resources
### Experts and Their Contributions
#### Erin Catto
- Iterative Dynamics with Temporal Coherence
- Modeling and Solving Constraints
- Soft Constraints
- Numerical Methods
- Continuous Collision Detection
- Understanding Constraints
#### Dirk Gregorius
- The Separating Axis test Between Convex Polyhedra
- Robust Contact Creation for physics Simulation
#### Erwin Coumans
- Forum Bullet
- Exploring MLCP Solvers And Featherstone
#### Tonge Richard
- Iterative Rigid Body Solvers 2012
- Iterative Rigid Body Solvers 2013
#### Brian Vincent Mirtich
- Impulse-based Dynamic Simulation of Rigid Body Systems
#### Kenny Erleben
- Book of Physics-Based Animation 2005
- Numerical Methods for Linear Complementarity Problems in Physics-based Animation
#### David Baraff
- Analytical Methods for Dynamic Simulation of Non-penetrating Rigid Bodies
- Fast Contact Force Computation for Nonpenetrating Rigid Bodies
- Linear-Time Dynamics using Lagrange Multipliers
- Physically Based Modeling, Pixar Animation Studios
#### Jim Van Verth
- Numerical Integration
- Understanding Rotations
#### Matthias Mรผller
- Position Based Dynamics
#### Michael B. Cline
- Post-Stabilization for Rigid Body Simulation with Contact and Constraints
#### Randy Gaul
- Separating Axis Test (SAT) and Support Points in 2D
### Books on Game Physics and Collision Detection
- Game Physics Pearls by Gino van den Bergen and Dirk Gregorius
- Real-Time Collision Detection by Christer Ericson
## ๐ Note
Cirobb is designed as an educational introduction to 2D physics engines. It intentionally maintains simplicity to facilitate learning and understanding of fundamental concepts.