A projection is just a dot product. The 3D case is only 3 floating point multiplications and two additions, meaning the CPU cache begins taking front row in the optimization concerns, and that's the first place we can begin making headway. But there are ways to optimize even further. For instance, iterating through the field with pre-calculated vector offsets. Each iteration is then 3 additions. Furthermore (and I don't remember whether I mentioned it in the above bit or not), most of the projections involved the same calculations every time and can be safely cached, due to the uniform nature of the grid we are using. And seeing as how perfect accuracy is rarely needed when doing collisions (heck, the first pass is just axis aligned boxes), we don't need to use the full separating axis method until there is a reason to believe a collision is possible, and collisions will rarely be across the entire ship region, so the problem in practice is much more manageable than might otherwise be assumed.
Edit:
I'll write a proper article once it's in the game.
Seems like zepplin mod is back
- fr0stbyte124
- Developer
- Posts:727
- Joined:Fri Dec 07, 2012 3:39 am
- Affiliation:Aye-Aye