Broadphase

fred
Posts: 19
Joined: Tue Apr 24, 2007 12:38 pm

Broadphase

Post by fred »

Hello,

After the axis sweep 3 process, the heapsort is useful to remove all duplicated pair.

As the axis sweep 3 add overlapping pair only in case of swapping on aabb edge, this doesn't create duplicated pair ? so, is the heapsort really necessary ?

Thanks,

Fred.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Broadphase

Post by Erwin Coumans »

fred wrote:Hello,

After the axis sweep 3 process, the heapsort is useful to remove all duplicated pair.

As the axis sweep 3 add overlapping pair only in case of swapping on aabb edge, this doesn't create duplicated pair ? so, is the heapsort really necessary ?
Fred.
Yes,

Bullet avoids doing the removal of objects during the sweep stage. This causes duplicate pairs. However, overall the performance is better, avoiding the random-access search for pairs. So instead of a random access pair deletion during the sweep and prune, an additional overlap check is done for all overlapping pairs, while dealing with duplicate neighbours.

It is just an optimizations to make things more cache friendly.
Hope this helps,
Erwin