Moving Wheels in Different Directions

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
AsteriskMonkey
Posts: 4
Joined: Tue Feb 17, 2009 1:11 pm

Moving Wheels in Different Directions

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Moving Wheels in Different Directions

Post 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.
AsteriskMonkey
Posts: 4
Joined: Tue Feb 17, 2009 1:11 pm

Re: Moving Wheels in Different Directions

Post 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
Post Reply