[ODE] Some remarks

Erwin de Vries erwin at vo.com
Sat May 17 15:05:02 2003


> > dGeomSetBody asserts on CHECK_NOT_LOCKED, but this isnt always
> > correct.
>
> do you have a situation where the assertion is invalid?
> a comment in collision_kernel.h says that: "the space is locked when it
> is currently traversing its internal data structures, e.g. in collide()
> and collide2(). operations that modify the contents of the space are not
> permitted when the space is locked". the idea is that if you call
> dGeomSetBody() (or any other function that modified geom state) then
> that might break assumptions that the collision code make be making
> during a collide.

Yes, but if you look at the implementation of the function you can see 2
parts. One part for a geom that is connected to a body, and another where it
is disconnected from a body. In the first situation it would be good to
assert, because the geom will take the body's orientation. In the second
situation the geom's orientation is copied from the body, so nothing
changes, thus the assert is not wanted here.

On a related note. In my application i require a special case for
dGeomSetBody(). I have a large pile of geom's that are part of the game
world. When the user starts interacting with a geom a body will be assigned
to this geom. However. The body's orientation needs to be taken from the
geom, so what i had to do was disable the assert in order for it to work. It
might be an idea to make the assert a little smarter by having it compare
the orientation of the body and the geom. A bit-exact memcmp equality test
would do fine.

> > CCylinder-CCylinder collision doesnt work
> > correctly. The top one sinks for about 50% into the other, and then
> > suddenly they notice the collision, and pop out.
>
> can you post some code that illustrates this problem? i have not noticed
> it before.

I just built the boxstack example, pressed 'r', and pressed 'c' twice. The
cylinders will not stack. If you're not having this problem it will probably
be due to my modifications in ode, which i will post soon. I have
implemented my quadtree space in the new collision system. This is much
faster than the hash space for large amounts of objects.

Erwin