Jump to content
  • Advertisement
Sign in to follow this  
FVIRTMAN

Car turn simulation

This topic is 4870 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a physic question. I want to make a simple 3D car game. I use newton equations : F = w*A (F = sum of forces (vector), w = weight of car, A = Acceleration (vector) I compute, and I have : S = (F/w)*t + S0 (S = instant speed (=new S0), t = time elapsed since last computing, S0 = previous speed computed. P = (F/w)*t²/2 + s0*t + P0 (P = position, P0 = last position) I have theses forces : F = c*||S0|| (throttle force), ||S0 ||= Norm of speed (front direction of the car), c = speed coefficient. + f*-S0 (air and ground friction force) f = friction coeff. + no weight, because I conclude that there is an opposite force for the road reaction. + something (to turn correctly : see above) First question : is it better to make a linear of quadratic air and ground force ? (f*-S0 or f*-S0²) Second one, and the most important : When I turn, I simply rotate the basis. But, of course it is logic, it is like a drive on ice, do you know what I mean ? if I turn, I slide out. Which force, with which coefficients, can I add to my force-sum to simulate a correct turning ? This force is the "something" I speek about in my sum. I want a simply thing, which can approximate the turn ??? I don't want general equation, just something approximated. Any others ideas to compute a good movement ? Thanks :)

Share this post


Link to post
Share on other sites
Advertisement
the centrifugal force is m.v2 / r.

v being the forward velocity, m the mass, r the radius of the turn (which can be approximated with the steering angle and the wheelbase of the car). The force pushes the car from the centre of rotation (again, approximated using teh steer angle and wheelbase) to the outside of the turn. The car tyres react to that force to push the car back in line.

That will not give you a satisfactory result really (at all). Car physics are much more complex.

However, you can try to simplify it a bit. If you take a tire separately, like a rolling cylinder, when the tire is steered away from its natural rolling direction, or when it's accelerated, the velocity at the contact point changes, it becomes non-zero. When the tire is rolling freely, the velocity at teh conatct opint between the road and the tire is zero.

in equations, the contact velocity is

vc = vl + w * r

vc : contact point velocity
vl : linear velocity
w : angular velocity
r : radius of the tire

when there is no roling resistance, vc = 0, => vl = -(w * r), the tire rolls and moves forward ok.

when steered, the direction of w changes, and vl - w * r is not equal to zero anymore.

The rubber then reacts to that change and attempt to correct its trajectory so that vl = -(w * r). In essence, the chnage in direction of the tire generates a force to counteract the deviation and to attempt to steer the tire back in line (to wheer it's pointing to).

The force is directed towards the side of the tire, and the maximum amount of force generated can only be equal to the vertical force times the grip of the tire. Vertical force, in the case of a very simple car, is m * g (mass times gravity).

Now, how much force given the deviation, that's another story. There are also more complex phenomenons, and it's ignoring the static friction of the tire, which gives the car stability in slow turns and a sharper steering. But that's also very complex.

If you want, look into the pacjeka formulae, which describes relatively simply and accurately the tire behaviour given a slip angle, contact velocities, and forces.

Now, you do that for each tires, and when the car slides around and turn, the cotnact point velocities at the tires will change (change in linear and angular velocities), which in turn will generate forces on the tire to get that gets transmited back to the car, that change the angular and linear velocities and so on. The different between ice and tarmac would be simply changing the grip coefficient on the tires (to change the maximum amount of force a tire can transmit).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!