disabled geometry still gets detected

foxbat

15-09-2006 14:07:34

Hi. I've created a capsule geometry without a body, and set it's position. I disabled the geometry with:

capsuleGeom->disable();

Now when I create a ray and collide it with the capsule, the capsule still gets detected! How can this be? According to the ODE manual, disabling a geometry will prevent it from being detected by the collide space functions. Is this something to do with the way collisions are handled in OgreODE?

Here's my collision code:

OgreOde::RayGeometry *ode_ray = new OgreOde::RayGeometry(length,_world->getDefaultSpace());
ode_ray->setDefinition(origin, direction);
_world->getDefaultSpace()->collide(ode_ray, NULL);

tuan kuranes

15-09-2006 14:41:28

Is this something to do with the way collisions are handled in OgreODE?

It's just a wrapper. In you code sample It's really ode calls, as you calling
dSpaceCollide2(space, geom)

It seems either an internal Ode bug (capsule is relatively new code)
-> check with other Geom type combination (box ray, sphere, etc..)

Or a bug in you code:
-> Can you set a a listener collision and check if your capsule is still disabled inside, and if it's not another capsule that is being collided ?

foxbat

16-09-2006 01:46:15

I tried a box and a sphere, but they also get detected. I did a check in the collision listener, and it turns out that my disabled objects generate contacts even though they are still shown as being disabled inside the callback. Actually sometimes they also show up as being active in the callback, but there's no where in my code where I re-enable them.

I also can't get collision bitfields to work. I tried a ray check, with it's collision bitfield set to all 0's, but it detects all objects, regardless of their bitfield category. I can't get bitfields to work on any other geometry types either, so I don't think the problem is specific to rays.

syedhs

18-09-2006 07:15:18

Correct me if I am wrong but the manual also says:

If there are any enabled bodies in an island then every body in the island will be enabled at the next simulation step. Thus to effectively disable an island of bodies, every body in the island must be disabled. If a disabled island is touched by another enabled body then the entire island will be enabled, as a contact joint will join the enabled body to the island.


It is not very clear whether it refers to bodies within island, but it makes sense that disabled bodies will be enabled automatically when they are touched by other enabled bodies.

tuan kuranes

18-09-2006 13:15:05

Seems to me that the question should be clarified on Ode Mailing list.
foxbat, you should really ask over there.

foxbat

19-09-2006 00:52:07

If there are any enabled bodies in an island then every body in the island will be enabled at the next simulation step. Thus to effectively disable an island of bodies, every body in the island must be disabled. If a disabled island is touched by another enabled body then the entire island will be enabled, as a contact joint will join the enabled body to the island.

That may be so, but I'm not using bodies. Just geometries with no bodies attached. I'll ask on the mailing list.