Rear wheel slip

mcan
Posts: 15
Joined: Tue Feb 03, 2009 10:04 am

Rear wheel slip

Post by mcan »

Hello, I'm trying to make a car simulator/game and right now I have a little problem.
My car is a rwd but it acts more or less like a fwd... no matter how much torque I add, and how little friction the rear wheel has, the rear never comes out like it should! It is more or less like it only under steers.

What am I doing wrong???

/Markus
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: Rear wheel slip

Post by ola »

Hi Markus,

Bullet's internal vehicle model is not suitable for drifting and such. Once you want that kind of features things become more complicated, you will need a proper tire friction model, maybe deal with how to simulate the differentials, the engine... I think most end up writing their own vehicle simulation for this.

Here is a link to a file containing lots of documents concerning car simulation:
http://physics.hardwire.cz/mirror/car_p ... ources.zip

which I found on this summary page:
http://physics.hardwire.cz/index.php?ac ... rent_id=42

Some hints:
- You'll need to understand how the numerical integration works, when you start adding forces to simulate suspension and such. The simulation might get unstable if your timesteps are too large. Bullet uses sympletic euler to integrate forces.
- You must apply forces for each INTERNAL bullet step. There is a callback function you can register in Bullet for this. Updating the vehicle physics outside will make your vehicle's behavior dependent on the graphics framerate.
- Using raycasts works fine for most cases, especially if you want to drive around on race tracks/roads.

Best regards,
Ola
mcan
Posts: 15
Joined: Tue Feb 03, 2009 10:04 am

Re: Rear wheel slip

Post by mcan »

Thanks for the fast answer Ola. I'm reading through the links and I'm amazed over the amount of data!

Is there by any chance any open source project using bullet, where I can look?

/Markus
mcan
Posts: 15
Joined: Tue Feb 03, 2009 10:04 am

Re: Rear wheel slip

Post by mcan »

Hmm ok so no open source project, but is there any good vehicle demo out there? I have looked at the BT vehicle demo, and to be honest it dosn't look (or feel!) so much like GTA if I say so :)

So when you give me the hints here below, do you mean that I should use the RaycastVehicle and add a special friction model to that? or shall I make my own Vehicle model with my own constraints and raycasts to that? Because that puts things in a completely different time usage... And I don't have that much time to spend.

(I have tried to make my own friction model with my RaycastVehicle and calculated the friction to 0 at all times, but the friction isn't applyed to the car model. Isn't this applicable or have I just left out something important?)

The simulation don't necessarily have to be "super" but it would be cool to be able to simulate small drifts.