LerpworksAcademy
On this page

Math and physics › Physics of motion

Collisions: how the engine knows that objects touch

Know first: Vectors: arrows you can add, Dot product: how much two arrows point the same way

A ball bounces off a wall, a hero stands on the floor, a bullet hits a barrel, a door opens when you walk up to it. Behind all of this is one job of the engine: on every step, find out which objects touch, and decide what to do about it. This page explains why physics works with simple shapes and how to test spheres and boxes for contact by hand. It shows how an engine avoids drowning in a million pairs, what a ray and a sweep are, and how a bounce comes out of the point of impact.

Why this matters

Forces move objects, but objects know nothing about each other. With no collision check, a ball flies straight through a wall. Collisions answer two questions. First, do the objects touch, and where? Second, what happens next? The engine can push them apart, reflect a velocity, slow a body down with friction, or only report “the player entered the water.” Once you know both answers, you can tell why a hero catches on a stair, why a ball will not bounce, and why a trigger stays silent.

Further in the article

  1. Two models: one for the eyes, one for physics
  2. Do they touch? Tests you can do by hand
  3. Two phases: rough first, then exact
  4. Raycasts: what can I see, and am I standing on the ground?
  5. What to do after contact
  6. Who collides with whom: channels and triggers
  7. In engines and Blender
  8. Where it breaks
  9. Connections: the same idea in other fields
  10. Key points
  11. Test yourself