2D Physics Engine
Build a 2D physics engine from scratch in modern C++ using only the standard library. You integrate motion over time, detect collisions between circles and polygons, and resolve them with impulses and restitution. A maths-rich project that produces convincing, interactive simulation.
Support Free C++ Education
Help us keep this platform free for everyone! Your support enables us to create more high-quality lessons, exercises, and interactive content.
What You'll Build
A 2D rigid-body physics engine that simulates gravity, collisions between circles and convex polygons, and realistic bouncing, with each frame rendered to the terminal or a PPM sequence.
Learning Objectives
- Build a 2D vector class with the operators the engine needs
- Integrate position and velocity with a fixed-timestep loop
- Detect circle and convex polygon collisions with the SAT method
- Resolve collisions with impulses, restitution, and friction
- Apply forces such as gravity and drag to rigid bodies
- Broad-phase cull candidate pairs to keep the loop fast
- Model bodies and shapes with clean classes and std::variant
Coming Soon
This project is in development. Register your interest and we'll email you the moment it goes live.
No spam. Unsubscribe anytime.
Coming Soon
This project is in development. Register your interest and we'll email you the moment it goes live.
No spam. Unsubscribe anytime.