[ODE] 2 simple questions

Nate W coding at natew.com
Tue Dec 10 16:57:04 2002


On Wed, 11 Dec 2002, [iso-8859-2] Góral wrote:

> I'm trying to make a car sim. Suppose my car is built from 2 bodies: lower
> part (chassis) and uperr part (windows and the roof). How should I correctly
> connect those 2 bodies?

Just make one body.  The chassis and roof will always move together, so
there is no need to have two bodies.

> Is there any method to disable collision between 2 parts of a chassis,
> or it's not needed?

In your collision callback function, you are free to disregard any
collisions you want.  Just return from the callback without creating any
contact joints in that case.

> Question 2 is about collision with terrain. My terrain is generated form
> heightmap, so i have some number of 'ground' trinagles. As for now, my idea
> is to put 4 thin boxes (each for each wheel) at the height of a terrain, but
> it won;t work if car is upside down. How should I properly handle collision
> with it. Any sources, examples, suggestions, anything please? :)

The "tri collider" extension (is it part of ODE yet?) was designed for
situations like that.  The only drawback is that, last I checked, it will
only collide boxes and spheres with the terrain.  Cars with spherical
tires work fairly well though.

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com