The complexities of collision detection
We already talked about the complexity of finding a collision in Chapter 3 when deciding how to implement a visual selection, either using ray shooting or buffer drawing. We’ve chosen to draw the instances into a separate buffer, avoiding collision detection entirely.
Now is the right time to do a short reprise of the complex topic and to present solutions to accelerate finding collisions between instances.
Avoiding the naive way
If we would check every triangle of every instance against all triangles of all other instances for collisions in the virtual world, this would come with immense processing costs. These simple, brute-force collision checks would grow exponentially, making it impossible to keep up a reasonable frame time when adding more and more instances.
Instead of using the naive solution, we should take a step back and think about possible types of simplification before implementing any kind of collision detection...