Tank Physics... need help?

grizzley90

03-02-2007 14:40:04

I have a tank... and im using the vehicule class.
I registered 6 wheels with 2 steering. The body is constructed from a convex hull. The tank however moves ridiculously slow.. this is the torque setting part.
Degree steering = new Degree(0);
float torque = 0.0f;
if (Manager.Instance.Input.KeyboardMouseInput.IsKeyPressed(KeyCodes.I))
torque = -10000.0f;

if (Manager.Instance.Input.KeyboardMouseInput.IsKeyPressed(KeyCodes.K))
torque = 12000;

if (Manager.Instance.Input.KeyboardMouseInput.IsKeyPressed(KeyCodes.J))
steering += new Degree(30);

if (Manager.Instance.Input.KeyboardMouseInput.IsKeyPressed(KeyCodes.L))
steering -= new Degree(30);
Player.Physics.setTorqueSteering(torque, steering);


I dont know how to fix it... It moves way to slow.

Chris Thornton

03-02-2007 19:49:48

Try increasing the friction between the car and the road, as with torques like that your wheels may accelerate so much that they can't get a grip. Try also reducing the torque value, as unless your chassis and wheels weigh a tonne, it's going to be hard to find a friction that works.

grizzley90

04-02-2007 23:24:40

so there really isn't much i can do other than play with values? :(

Chris Thornton

05-02-2007 00:40:09

It's not really playing with the values, just finding values that are reasonable for what you're doing. Have you set your tank to have a high mass? There was one time too when I forgot to apply gravity, and as such the wheels would never make good contact with the ground, and it moved insanely slow.

If you tell the OgreNewt Debugger to draw the lines of it's collision meshes, can you see the wheels spinning (either normally or so fast that they appear to turn backwards)?