Chapter 6. 2D Optimizations
Now that we know how to check for collisions between 2D primitives, it's time to start thinking about performance. Checking for collisions between a few objects is trivial. However, when it comes to checking for collisions between hundreds, or even thousands of objects, that's going to be tricky. With so many objects, performance really starts to matter. In this chapter, we will cover topics to improve performance when checking for collisions between objects. Specifically, we will cover:
- Containing circle
- Containing rectangle
- Simple and complex shapes
- Quad tree
- Broad phase collisions