Is there a space-partitioning data structure?

The TOctree class is a templated class that you provide some classes to interact with it. You need to do custom work to make this happen, as the octree needs adapters to understand how to partition your data. You can look at the current uses in the engine to get a feel for what needs to be done. Unfortunately, it is too involved to try and answer via a forum post. Your best bet is investigating current uses and learning from those