[ODE] Getting Bodies to pass through one another?

Aras Pranckevicius nearaz at gmail.com
Wed Jun 29 16:42:10 MST 2005


> The thing is, I need regular physics to apply when they interact with other
> particular bodies (I have the body IDs in a list). Imagine something like,
> ghosts can pass through each other, but can't go through walls.

Basically, you just don't create contacts between these bodies. Now,
you can do that yourself, but ODE's collision system can already do
that for you (and that would be more efficient).

In ODE, all geoms have "category bits" and "collide bits" (read the
docs for them). In your case, you'd choose a bit for ghosts (e.g. 1st
bit - (1<<0)) and a bit for walls (e.g. 2nd bit - (1<<1)). You'd setup
these category bits for their geoms.

Then, for each geom you'd set up the "collide" bits - which other
classes does it collide with. Ghosts would collide with walls, but not
between themselves - so their collide bits are (1<<1). Walls probably
don't collide with anything, so set the bits to zero. Well, walls do
collide with ghosts, so you can set the ghosts' category bits also,
but in ODE just one bits-test pass is enough.

In real world scenario, of course you would have more categories.

-- 
Aras 'NeARAZ' Pranckevicius
http://nesnausk.org/nearaz | http://nearaz.blogspot.com



More information about the ODE mailing list