Page 1 of 1

Moving Wheels in Different Directions

Posted: Sat Feb 28, 2009 12:23 am
by AsteriskMonkey
Hello all,
I'm new here , liking the physics things you got going on.

i'm(we're) currently using the library in a tank game an i was wondering if you knew of a way to move
the wheels within a vehicle class in seperate directions at the same time.

i was looking to have say 4 wheels either side and on a left or right turn have them move in opposite directions
to simulate how a real tank turns.

i've tried the accelerate value of individual wheels as well as the "forward" vector both to no avail.

if anyone knows of a way to do this, it would be appreciated.


Thank You

Re: Moving Wheels in Different Directions

Posted: Sat Feb 28, 2009 2:53 am
by Norbo
Changing each individual wheel's acceleration field should do the trick. The vehicle's accelerate method is a shortcut that overwrites all wheel acceleration fields, so be careful that you aren't calling it after setting up each individual wheel acceleration.

You'll probably also need to increase the wheel tire grip relative to the wheel sliding friction since otherwise the tank will have a great deal of trouble turning. The reason why applying progressively larger accelerations doesn't affect this is that the applied drive force is capped by the tire grip and normal force.

Re: Moving Wheels in Different Directions

Posted: Sat Mar 07, 2009 10:14 am
by AsteriskMonkey
i tried changing the acceleration fields individually but it just would not turn properly..in the end i went with changing the vehicles orientation matrix on the Y.
Because of this i did have to lower the centre of gravity a bit to stop the vehicle tipping on corners, but overall its working out well.

Thanks for the help
AsteriskMonkey