Design a Game Physics Engine
Design a 2D physics engine for games. Include rigid body modeling, collision detection (AABB, SAT), collision resolution, force application, vector math, and physics simulation stepping.
Suggested time: 45 minutes
Loading the workspace...
About this problem
A game physics engine is one of the most technically demanding OOD problems because it combines numerical simulation (integration), spatial algorithms (broad/narrow phase collision), the Strategy pattern (pluggable detection), and the Composite pattern (compound colliders). Let's define exactly what the system must do.
What your design needs to cover
Rigid Body Dynamics
Two-Phase Collision Detection
Impulse-Based Collision Resolution
Multiple Collider Shapes
Fixed-Timestep Simulation
Key challenges the editorial covers
Learn from other designs
Related problems
Design a Resource Management System (advanced)
Design an Entity-Component System (advanced)
Design a Board Game Framework (advanced)
Design an LRU Cache (advanced)
Design a Permission and Role System (advanced)
Design an Operating System Task Scheduler (advanced)