I need information on how vechicle movement works [message #88576] |
Wed, 19 May 2004 00:17 |
|
gibberish
Messages: 366 Registered: May 2003
Karma:
|
Commander |
|
|
Dunno If this will help you much, but I might as well get the ball rolling:
If a vehicle is moving in a straight line we have:
Circumference = Pi * WheelRadius * 2
- The Distance a vehicle travels
Distance = Rotations * Circumference
- Also Distance is related to speed
Distance = Speed * Time
Note: Speed is in GameUnits per second.
- So putting this together we get:
Speed * Time = Rotations * Pi * WheelRadius * 2
- However time is determined by the interval between the frames.
Time = 1 / FPS
- So we now have
Speed / FPS = Rotations * Pi * WheelRadius * 2
- So re-arranging for rotations we get
Rotations = Speed / (FPS * Pi * WheelRadius * 2)
Now you can just multiple Rotations by 360 to get Degrees or 2 Pi for Radians.
Note: If you use Radians you can elimiate Pi from the calculation completely:
RadiansPerFrame = Speed / (FPS * WheelRadius)
|
|
|