A 2D physics engine written in C with SDL2 rendering.
My goal with this project is to use this as a very simple physics engine for elementary RL training as a learning exercise. Future projects will leverage this engine as a sandbox for training agents on classic control tasks like ball balancing, target hitting, and multi-body coordination.
Note: The RL interface is a work in progress.
2026-01-30.02-54-16.mp4
2026-01-30.03-04-51.mp4
- Circle and rectangle rigid body simulation with rotation
- Collision detection and impulse-based response (SAT for rectangles)
- Configurable gravity and world boundaries
- Adjustable body properties (mass, restitution/bounciness)
- Debug visualization for velocity vectors and contact points
- JSON scene loading system
- Deterministic RNG for reproducible simulations
- Uint system where 100 pixels = 1 meter
- C compiler (clang or gcc)
- SDL2
makemake run