aomarks / bridgesim

A starship bridge simulator for the web.
https://aomarks.github.io/bridgesim/
16 stars 3 forks source link

optimize collision detection #5

Closed aomarks closed 8 years ago

aomarks commented 8 years ago

The collision detection system currently has quadratic complexity. This limits the number of collidable objects we can spawn before performance starts to drop (seems to be around 1000 on my machine). Maybe add a "broad phase" to the algorithm that does e.g. spatial partitioning.

d4l3k commented 8 years ago

I've implemented quad trees but there is some more stuff that could be done.

The delta work might be able to be used for really efficient updating of the quad tree.

aomarks commented 8 years ago

The quad tree optimization seems to be performing great. I'd say this is fixed.