It's like sweep and prune in that it sorts a list of nodes but it only
maintains one list of nodes. It does a sweep just like sweep and prune
on one axis but instead of storing this result for the second sweep it
just goes ahead and tests for a collision on the second axis.
It uses the single node list to represent the axis with the least
collisions. It determines which axis has the least collisions by
switching to the one it thinks has more every 7th time step and stores
the results. Look at the code in the SVN to get a better picture.
SingleSweepDetector is 2-3 times faster then SweepAndPruneDetector,
according to my profiler (nProf), based off percentage of CPU time
used. I would have to get a better profiler to make an actual
comparison.
"SweepAndPruneDetector" would update roughly every second.
"SingleSweepDetector" would update three times then pause for roughly
half a second.
Guess you can't really "judge" the speed of these 'eye' measurements,
but it answers a what if question...
"What if you had 25626 boxes applied to physics?"
Anyways, I'll much enjoy the release of 1.5 :-)
It does not have the stutter that you where talking about and does
seems to run faster then Single sweep, but it has to sort the 2 lists
or nodes and the profiler tells me this is the most expensive part of
the algorithm (with 25,000 objects).
I'm thinking about keeping the SingleSweepDetector because it does
less sorting. What do you think I should do? Keep it or delete it?
I made a demo like you were talking about with over 25,000 objects,
and it ran better then I was expecting (I thought you had some kind of
super computer) with a few updates a second.
I also accidentally made a demo that had 250,000 objects and Vista
froze. So don't try this at home!
> > comparison.- Hide quoted text -
>
> - Show quoted text -
So one detector might be better for a platform game while another for
the pool game. Besides all the more to add to the "feature" list ;-)