Physics simulation makes things move the way the world does: falling, colliding, bending, flowing. In games and animation it must look right and run fast; in engineering it must be accurate. Either way, you turn laws of motion into small time steps and keep the numbers from drifting or blowing up.
Key concepts
- Integration: advance position and velocity from forces each step; explicit Euler is simple but unstable, and semi-implicit or Verlet methods behave better.
- Collision detection: a cheap broad phase finds close pairs, then a narrow phase computes exact contacts.
- Constraint solving: contacts and joints are resolved by iterating impulses or forces until they agree.
- Rigid, soft and fluid bodies: different models for solids, cloth and flesh, and liquids or smoke.
- Time step and stability: smaller steps and fixed rates give repeatable, stable results.
Vocabulary
- Rigid body: an object that never deforms, described by mass, position, orientation and velocities.
- Impulse: an instant change of momentum, used to resolve collisions.
- Bounding volume: a simple shape around an object, used to skip impossible collisions.
- Particle system: many tiny points with simple rules, used for sparks, smoke and cloth.
What to study, in order
- Newtonian mechanics: velocity, acceleration, force, momentum, energy.
- Simulate a bouncing ball and a pendulum; compare Euler with a better integrator and watch the energy.
- Add circle and box collisions with impulses and friction in 2D.
- Build a spring-mass cloth with Verlet integration and distance constraints.
- Read about a position-based or particle-based fluid method, and implement a small one.
Related tags
#numerical-analysis #game-development #simulation #linear-algebra