Vehicle wheel tunnelling

Jack000

07-03-2010 23:18:50

Hi guys

I've been working on a bicycle simulator, and I thought it would be a good idea to use the vehicle function in ogrenewt to simulate the bike physics. The problem is that the wheels tunnel through the terrain with the slightest provocation. It seems to depend on the vehicle settings - a high friction in the wheels causes it to tunnel immediately, and when I set the shock value higher it only tunnels when it hits something.

here are my values (I'm just using the simplevehicle class from the demos):
static SimpleVehicle::CAR_CONFIG bikeconfig =
{
"cylinder.mesh",

// FL_TIRE
{"cylinder.mesh", {-3.0f, -2.0f, -3.0f}, {0.70710552f, 0.0f, 0.70710552f, 0.0f}},

// FR_TIRE
{"cylinder.mesh", { 3.0f, -2.0f, -3.0f}, {0.70710552f, 0.0f, -0.70710552f, 0.0f}},

// RR_tire
{"cylinder.mesh", { 3.0f, -2.0f, 3.0f}, {0.70710552f, 0.0f, -0.70710552f, 0.0f}},

// RL_tire
{"cylinder.mesh", {-3.0f, -2.0f, 3.0f}, {0.70710552f, 0.0f, 0.70710552f, 0.0f}},
};


Ogre::Real width = 1;
Ogre::Real radius = 1;

// for now just to get it going
Ogre::Real mass = 100.0f;
Ogre::Real friction = 0.8f;
Ogre::Real suspensionLenght = 0.2f;
Ogre::Real susSpring = 100.0f;
Ogre::Real susShock = 3.0f;


I'm making it move by using addLocalForce/addTorque in a callback function.

any ideas? I got these values by guess/check, but I really have no idea what I'm doing!

here's a shot of my "vehicle" so far:
Is the low framerate a problem for physics calculation?

kallaspriit

14-03-2010 21:47:09

You want pretty high physics update rate for vehicles, try setting world->setUpdateFPS() to atleast 120, I am actually using 300 for my vehicle. Eexact solver mode also helps. What do you mean by using the "vehicle function" of OgreNewt, you are using the latest with NGD 2 beta? There isn't a real vehicle solution available for OgreNewt yet, but it is in the works.

majc

15-03-2010 14:14:23

HI,

You made that terrain with the trees or it came with Ogre?

Jack000

21-03-2010 21:06:57

thanks for the suggestions. I turned up my physics and it seems to have helped, but the wheels still seem to be tunnelling through when there's a steep hill. How do I turn on continuous mode? Also ,what should I set the maxupdatesperfame parameter to? thanks for your help :D

oh, and I'm just using the code from the simple vehicle demo to make the vehicle. Only the wheels are tunnelling, I have never seen the body of the vehicle tunnel through yet.

I found the trees in the blender forums and exported them using the ogre export tool. The terrain heightmap I drew by hand and is rendered using the new terrain features in ogre 1.7

Jack000

21-03-2010 22:31:52

tweaked the values a bit and I think I fixed it. The problem was that the spring value wasn't high enough to support the weight of the body, I think.

majc

22-03-2010 09:21:29

Thanks mate.