Re: [ opende-Patches-1335198 ] Sweep and Prune Space
"David Walters" <[email protected]> Fri, 9 Nov 2007 16:08:53 +0000
| Newsgroups | gmane.comp.lib.ode |
|---|---|
| Message-ID | <[email protected]> |
Okay, I've added this new Sweep and Prune space. I had to do some additional work to get it though: * The space doesn't store geoms as a usual linked list, so a custom destructor was required to remove / destroy geoms under it's ownership. * Each call to collide caused a memory allocation, I've changed that to use a scratch pad mechanism so allocations are only performed when the geom count changes. Now I think of it there is probably room for improvement here by replacing my code with a dArray. * The code had a dependency on the radix sorter from OPCODE. To break this I've copied the inner workings into the SAP source file - it doesn't amount to very much when you boil off the fluff. * The was the radix sorter was used before would leak, now it uses a very simple reference counter to catch this. Here a few other notes: * The radix sorter uses IEEE floats, so AABBs are actually cast if you're building in double precision mode. I'm hopeful that this isn't a problem - if it is there are other spaces you could use for now. * I changed demo_crash to use this new space. Finally, I've not profiled this at all - I'm hoping Mark Williams, etc. can tell me if it's even faster now I've incorporated it properly. Regards, David Walters