[ODE] Colliding with a static space with thousands of geoms

Peter Wilson peterw at hb-studios.com
Fri Sep 7 08:11:19 MST 2007


Hello,

I'm running into some performance issues when colliding spaces.  I am using
the two space approach since I have a lot of static objects that don't need
to collide with each other.  The static space has a triangle mesh and some
body-less geoms for obejcts (trees).  The dynamic space has a few bodies,
including a car that is composed of a box and wheels.

I discovered early on that the current ODE implementation of dSpaceCollide2
doesn't always work with quadtree spaces since it tries to iterate through
all the geoms in the space with fewer geoms.  You can't iterate through
geoms in a quadtree space using conventional means, so no collisions were
being detected if the larger of the two spaces happened to be a quadtree
space.  So there was no hope of making *both* my dynamic and static space a
quadtree space.

I decided to make some changes to dSpaceCollide2 and add some supporting
functions to the dxQuadTreeClass to allow calling dSpaceCollide2 with two
quadtree spaces.  It works great - much faster than any other combination of
spaces for my particular game.  I can post the changes I made to
collision_space.cpp and collision_quadtreespace.cpp if anyone else is
interested in colliding quadtrees with quadtrees.

So now on to my problem.  Things work great when there are dozens of dynamic
bodies/geoms and hundreds of static geoms.  Things really slow down once I
put a few thousand static geoms in the world, even when there are still a
small number of objects in the dynamic space.

The physics timestep I'm using is quite small: 1/500.  I'm using dWorldStep
because dWorldQuickStep isn't accurate enough for the car physics I want. 
Is there any way I can hope to collide a dynamic space with dozens of
dynamic objects against a static space with thousands of static geoms and
still get good performance?  Any other tips on what I might try to speed
things up?

Thanks,

~Peter Wilson
-- 
View this message in context: http://www.nabble.com/Colliding-with-a-static-space-with-thousands-of-geoms-tf4401817.html#a12557173
Sent from the ODE mailing list archive at Nabble.com.



More information about the ODE mailing list