|
|
"Chambers" <bdc### [at] yahoocom> wrote:
> Of course, and I never meant to imply that you could do without calculating
> it for those collisions that do occur. I was only looking for a way to
> cull those which do not.
>
> ....Chambers
For a static area-filling I've used 'binning' to speed up intersection
checks when adding new items:
Chop one or more of the axes into bins of equal width (of about twice the
expected interaction radius), covering the extent of the items. A simple,
fast function will then tell you which bin any point belongs to. Each bin
uses a variable length array to hold a sorted list of the items in that
bin.
To add a new item check the bins which span item_pos +/-(item_radius +
max_radius) for collisions.
For non-static systems check each item against the items in each bin
spanning item_pos +/-(item_radius + max_radius + |item_vel| + |max_vel|).
Because the items in each bin are in a sorted array you can discard some of
these quickly, too.
My code is on another computer; I'll try to remember to post it later.
Hope this helps a little.
Mike Andrews.
Post a reply to this message
|
|