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.