There's more...

Given that we implemented the split function as a delegate, we can improve and fine-tune the BSP by implementing new functions and assigning them to the builder as we see fit.

For example, you could try your own split function that doesn't split by half, but with a random value using the half as the pivot.

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition 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.