[ODE] GeomTransform

Erwin de Vries erwin at vo.com
Sun Dec 30 06:27:01 2001


Hi,

I'm wondering what would be the best way to get the body of a Geometry that
is encapsulated by a GeomTransform. Obviously in the nearcallback i could
check if the current geom is a geomtransform, but that doesnt work very
nicely when the GeomTransform is in a GeomGroup, or in another
GeomTransform, or.... It would require me to traverse through the entire
tree of geometries.

It appears to me the preferred way is to add 2 dxBody pointers to the
dContactGeom struct, which are filled in by the contact generation
functions. For instance:

The 2 geoms in the near callback are expanded like this:
- Box1
- GeomGroup
    + GeomTransform
        - Box2
    + Sphere1
    + Sphere2

The callstack for the collision will be as follows:

dCollideG
    dCollideT
        dCollideBB
    dCollideSB
    dCollideSB

In this case dCollideSB will twice generate the corresponding bodies
correctly, but dCollideBB will not. We could easyly configure dCollideT to
override one of the body pointers filled in in dCollideBB, and then the
resulting bodies can be used in the near callback when creating and
attaching the contactjoint without the trouble it is now.

I think i could implement this myself quite easyly, but i'd like to hear
your opinions.

Erwin