[ODE] conveyor belts and moving platforms

Benny Kramek benny at kramekweb.com
Thu Oct 10 06:46:02 2002


David McClurg wrote:
> In my game, I'd like to simulate conveyor belts.  Looking at the doc, a contact joint using dContactMotion1/2 seems to be the technqiue required.  Does anyone have an example of that?  I looked in ode/test but couldn't find anything.

It's fairly simple. First make sure that you correctly set the fdir1 
vector in the dContact structure. Then make sure that you use the 
dContactFDir1 and dContactMotion1 flags on the surface mode. Then set 
the correct value for motion1.

> Also, if i want to simulate moving platforms (boxes with bodies) that the player can jump on, should friction keep the player on the platform or will I need a special contact joint?

Friction will keep the players on the platform with no problem. Just 
make sure that there is enough friction.

> If my player is a ccylinder or sphere, and I don't want my player to rotate as it moves in the world via SetVel, how do I constrain the body to not rotate?

One way is to put very large values in the inertia matrix. This will 
make the body difficult to rotate. Another, maybe better way, is give 
your body an inertia of a sphere, and to always have the geom oriented 
in a fixed orientation.