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):
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?
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?