Broad phase collisions

Simple video games might have hundreds or thousands of objects. More complicated games might even have millions. Testing collisions between all of these objects will quickly become computationally expensive. This is why we need broad phase collisions. Broad phase collisions are not accurate, they let us know if two objects are too far apart to touch.

For example, let us assume we have two rectangles. We could contain both rectangles in circles. If the resulting circles are not touching, there is no reason to check whether the rectangles are colliding or not. In this scenario we do not have to do complex intersection testing because we first test simple objects.

Getting ready

The QuadTree class that we have built is ideal for ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.