Reading — step 1 of 5
Read
~1 min readMath & Integration
What Physics Engines Solve
A physics engine simulates how rigid bodies move and interact:
- Gravity pulls objects down.
- Forces apply.
- Bodies collide and bounce.
- Friction slows motion.
Used in:
- Games: realistic ball bouncing, character collision, vehicle physics.
- Simulations: engineering, training (driving sim, robotic arms).
- Animation: ragdolls, cloth, fluids.
- Scientific: molecular dynamics, astrophysics.
Real engines:
- Box2D (Erin Catto): 2D, used in Angry Birds.
- Bullet Physics: 3D, used in many games + films.
- PhysX (NVIDIA): GPU-accelerated 3D.
- Havok: commercial AAA.
- Chipmunk: 2D, simpler than Box2D.
- Rapier (Rust): modern, fast.
We'll build 2D rigid body physics. Includes:
- Vector math.
- Numerical integration (Euler, Verlet).
- AABB / circle collision detection.
- Impulse-based response.
- Constraints (joints).
- Broad-phase optimization.
By the end: balls bouncing in a box, stacked boxes, characters jumping.
Reference: Game Physics Engine Development (Millington), Box2D source, Erin Catto's GDC talks.
Each frame:
- Integrate forces → velocities → positions.
- Detect collisions.
- Resolve collisions (impulses).
- Render.
Loop runs at fixed step (e.g., 60 Hz). Frame time independent.
Modern games use physics for everything from cloth in characters' clothing to destructible environments. Physics is a core engine subsystem.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…