[ODE] Latest CVS with VC++ workspace
Pierre Terdiman
p.terdiman at wanadoo.fr
Fri Jul 4 08:59:01 2003
> http://www.coderfarm.com/pubs/Physics/ODE_CVS_Win32.zip
Interesting.
- In the sphere-mesh contact generation code I see you do the
sphere-triangle collision again (with code "ripped from opcode 1.1"). In
Opcode 1.3 I have a special mode especially thought for this case. You can
actually disable the final sphere-triangle tests on the Opcode side, since
you're doing them again to derive contact data. Just add :
Collider.SetPrimitiveTests(false);
Should go a little bit faster.
- Beware of temporal coherence. The nasty O(n) loop to find the correct
cache might very well kill your gains (sphere-mesh is fast already,
especially on that small bunny). I use another approach in my engine : I
have a single cache / sphere. The trick is to invalidate the cache as soon
as the sphere collides with a new mesh. It works well since usually a single
sphere collides with the same (usually bigger) mesh for several frames. You
lost coherence (falling back automatically to normal mode) when the sphere
collides simultaneously with multiple meshes.
- For box-mesh, temporal coherence can actually be *slower* if the contact
generation code is very expensive. Typically temporal coherence gives more
triangles to analyze for contact points, so it's only a clear win when the
contact generation code is fast, as in sphere-mesh. [Now I'm only saying
this because *my* box-triangle contact code is very exepensive, I don't know
about Erwin's one]
In any case those are probably small optimizations that won't make a lot of
differences (unless you have 200 spheres on a huge terrain, there it helps a
lot).
Else my favorite is TC + hybrid trees....
Pierre