btGeneric6DofSpringConstraint apply torque

Post Reply
spriggsy
Posts: 3
Joined: Mon Dec 31, 2012 10:21 pm

btGeneric6DofSpringConstraint apply torque

Post by spriggsy »

Hi, im using libgdx to create a driving game.

I went through the raycast vehicle setup, but didnt like the way the wheels where simulated with rays instead of rigid bodies.

ive now recreated my veh with btGeneric6DofSpringConstraint connecting the wheels to the chassis. i have the wheels rolling and moving with the suspension.

im now trying to work out how to apply torque to the wheels to give power? after that will be the steering issue.

can any one steer me in the right direction? many thanks
tonydongyiqi
Posts: 1
Joined: Thu Oct 23, 2014 7:46 am

Re: btGeneric6DofSpringConstraint apply torque

Post by tonydongyiqi »

I met the same question with yours. Have you found out any solution?
LEgregius
Posts: 26
Joined: Tue Oct 14, 2008 1:34 am

Re: btGeneric6DofSpringConstraint apply torque

Post by LEgregius »

I'm not sure what your background is, so forgive me if you are a vehicle dynamics expert, but making a decently driving vehicle is a lot more complex than jointing rolling wheels to body. That said, I'm not sure why it's hard to apply torque to the wheels. You should be able to just apply a torque directly to the wheel body. The difficulty is applying the right amount of torque.

The raycast vehicle is actually a very good approximation for a street vehicle, and for a casual sort of game, it should work well in many situations. I've used it for a few simulations, and I know a number of games use it. Making a jointed vehicle behave they way you need can be pretty daunting. There has been on and off discussion of making the raycast vehicle do a shape cast for the wheels, which would require extra work in handling the collisions received, but it would be worth it on more complex terrain.
Post Reply