[ODE] BSP And ODE?

Pierre Terdiman p.terdiman at wanadoo.fr
Thu May 8 13:32:01 2003


> > However, I suspect this won't be faster than the dumb single-tree
> approach.
>
> It seems faster to me, but then I am expecting it to be faster to begin
with
> ;)

Bottom line is : profile & see.

It just gave me an idea, however : we could include visibility tests
directly within OPCODE. The sphere-collider, for example, would then accept
another parameter : the set of frustum planes. In each node, there would be
a visibility test first, then and only then the usual sphere-box test would
be performed. So it would be a mix of plane-collider & volume-collider in a
single run.

Of course it's only useful when you want to collide a volume against visible
stuff only. It works for a camera, but that's about the only case.... (in
standard rigid body simulation you usually do the collision tests anyway -
modulo the whole "simulation culling" thing).

Now, thinking a bit more while I'm writing.....

It may not be faster than actual code. In fact it might very well be slower,
because of extra visibility tests. The thing is, if the sphere is small
compared to the world, it won't collide with culled nodes *anyway*, since
they're far from it. So the already existing sphere-box overlap test prunes
roughly the same nodes as the visibility test I was thinking about ! D'oh.

That's also why I don't think using a tree / BSP node is very useful in the
end - culled/non-colliding nodes are going to be discarded very quickly
anyway.

In the end I'm back to my original position : if you *really* want it to be
fast, use temporal coherence. It's O(1), you can't really beat that :)

- Pierre