You are thinking of Coarse collision detection, Josh was speaking about fine collision detection.RedDwarfMining wrote:Collision detection hogging frame rates? Turn it off. Turn it on when a entity nears another...should take awhile!
Coarse collision detection, the long distance stuff was cheap and fast.
That is typically implemented as a minimum sphere around a ship, if two spheres interact (between two ships) then you know they are going to need collisions.
That is really quick, take the two points in space of the center of those spheres, get the distance between them, and compare it to the sum of the two spherical radii, if it is smaller they are colliding, if the same size or larger, they are not colliding. Easy.
Combined with Octtrees, you can be sure to only check things in a small region against each other. So you are doing typically less than 100 calculations with 100 ships in a region of space, per frame.
(Octtrees do pretty much exactly what you described, but only allow checks against nearby things)
The issue Josh had was with the fine collision detection, the stuff that detects exactly where ships are, the stuff that allows you to fly through asteroids, or to skim past the surface of a carrier. Or collide with an antenna.
This is a much more complex issue, and it seems Josh has resolve at least part of it.
With most systems, each part needs to be a convex mesh. And larger, or complicated ships need more meshes.
Each mesh usually needs to be tested against at least the ones that collide with the sphere from the coarse collision detection. Which could be the entire ship, if one is small and one is large.
There are options for this too, but they are too varied and complicated for me to bother typing out right now.
But don't worry about all that, Josh has it covered from the sounds.