Hi,
I'm implementing a collision-detection system on my 3D game. The idea is to use an octree to partition space so I can save up CPU by not needlessly testing for object collisions. I'm sure those of you who can help me will know all this by now but I'll link some relevant things nonetheless:
Introduction to Octrees (this is the basis tutorial I'm learning from)
My problem is this:
I will have a great disparity in size on the objects that I want to test collisions against. It would be something like 100 to 1 or more, meaning that there are objects that are more than 100 times the size of the others. Think of it as having big planets and small asteroids, though their meshes will not be necessarily spherical.
My problem is that when partitioning the space in cubes for the octree, the "planets" will leave considerable space empty in their bounding-box, considering their relative scale to the asteroids'. This means that I could reasonably have dozens of asteroids in the planet's "super-node", in each planet. This is still better than brute-forcing, of course, but I don't reckon I will be able to get a decent enough performance to have several planets being tested with dozens of asteroids each frame.
Am I thinking about this wrong? Should I consider testing whether the asteroids' enclosing node is able to collide with the planet's sphere rather than using the bounding-box? Is using an octree in this sort of situation just a bad idea? Kind of lost as to how to think this, any help would be appreciated.
TL;DR:
Using an octree to collision test objects. Have objects that are very large relative to others, and its nodes will reasonably contain dozens of small objects.