🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Car physics ?

Started by
8 comments, last by Dirk Gregorius 6 years ago

Hi, what is the simplest way to do car pysics ?

How do i know how much the car will rotate with a certain wheel steering rotation ?

And what if the wheels both rotate ?, front and back ?

Or how about a car with 6 wheels ?

 

How do you calculate the car rotation ?

 

thanks

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Advertisement
6 hours ago, the incredible smoker said:

what is the simplest way to do car pysics ?

Fake it. If the player is holding the steer button, then rotate the car by some arbitrary amount.

6 hours ago, the incredible smoker said:

And what if the wheels both rotate ?, front and back ? Or how about a car with 6 wheels ? How do you calculate the car rotation ?

To do it properly, it's all just friction forces.

When you apply a force on an object at a location other than the center of gravity, you can calculate a torque to apply as well. The torque causes angular acceleration, causing angular velocity, causing the car to rotate.

When you accelerate in a car, the wheels start spinning faster than the ground, which causes friction to resist that motion, which tries to equalize the speed of the wheel/road, and seeing as the road is fixed in place, this pushes the car forwards.

When you steer, you start pushing the front of the car sideways when you accelerate, which starts to rotate the car.

What's more, when you steer, the front wheels are no longer pointing in the same direction that the car is travelling it. This causes the wheels to slip sideways. The friction of a wheel sliding sideways is actually very different to the friction of a car sliding forwards/backwards, and the front wheels try to resist this sideways slipping motion, which also applies a force on the front of the car, causing a torque too.

15 hours ago, the incredible smoker said:

And what if the wheels both rotate ?, front and back ?

Or how about a car with 6 wheels ?

If for instance, we talk only about usual steering using the front wheels and we make a left turn, the left wheel gets more rotated inwards than the right wheel. You can model this by aligning both wheels to the tangent of two adjacent circles, where the difference in radii is the distance between the wheels, but both circles have a common center to minimize unwanted side slip. These radii define the turning radius.  The same principle can be applied to all other steering wheels as well.

(I'm no expert - in fact i remember this from building Lego cars as a child :) )

15 hours ago, Hodgman said:

Fake it. If the player is holding the steer button, then rotate the car by some arbitrary amount.

I know i can fake it, i can also have hoovercars without wheels.

The thing is i want it to be exact, like i have the wheels rotating also, its done with math, the wheels rotate perfect.

The next thing is the rotation of the car itself, i dont really wanto use weights and gravity and complicated stuff, just the most simple but realistic movement.

 

15 hours ago, Hodgman said:

What's more, when you steer, the front wheels are no longer pointing in the same direction that the car is travelling it. This causes the wheels to slip sideways. The friction of a wheel sliding sideways is actually very different to the friction of a car sliding forwards/backwards, and the front wheels try to resist this sideways slipping motion, which also applies a force on the front of the car, causing a torque too. 

I dont think the rotation movement depends on weight, weight has only effect on acceleration and slowdown for movement.

Maybe i should get the direction of both back and front wheelsets, and get the average value to start with ?,

ok that will steer super fast, maybe i need the friction to slowdown first before rotating thats right, not a big deal.

 

15 hours ago, Hodgman said:

When you steer, you start pushing the front of the car sideways when you accelerate, which starts to rotate the car.

Nice, i will adjust the center point of the car to between the 2 back wheels.

 

6 hours ago, JoeJ said:

If for instance, we talk only about usual steering using the front wheels and we make a left turn, the left wheel gets more rotated inwards than the right wheel. You can model this by aligning both wheels to the tangent of two adjacent circles, where the difference in radii is the distance between the wheels, but both circles have a common center to minimize unwanted side slip. These radii define the turning radius.  The same principle can be applied to all other steering wheels as well.

(I'm no expert - in fact i remember this from building Lego cars as a child :) )

Oh please dont make it more complicated.

Something like grand turismo 1 should be do-able with my current lego skills, then i can make a very simple game to test online gaming.

Maybe with some rollcage loopings hope so..

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

If you are really into this topic, there is a very interesting (and entertaining) read (if you haven't found it already), very simple and if you have some time to experiment... I made my first car stuff upon this paper many years ago and it was great fun :)

http://www.asawicki.info/Mirror/Car Physics for Games/Car Physics for Games.html

But if you are not in the mood, it comes with source that you can use ;)

 

Thanks for the link, to bad the source code is not available any more.

All the professor stuff i dont understand, i can only read codes.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

No worries, I may have the sources somewhere, I'll take a look when I get home.

Anyway, don't be scared, just basic elementary school math is in there :) (ok maybe some high school stuff too)

Professor stuff is when it's full of integral signs and all possible Greek letters are used in a single equation :D

 

 

12 hours ago, the incredible smoker said:

Thanks for the link, to bad the source code is not available any more.

Check your messages ;)

17 hours ago, bmarci said:

Check your messages ;)

While you're at it. I would appreciate a private post as well if you don't mind to share :)

This topic is closed to new replies.

Advertisement