![]() |
|
#9
|
|||
|
|||
|
I do use animationpath.constantspeed when I begin. But what I need to know is not only the initial speed. If I want to accelerate or decelerate a car, I would like to increase or decrease the car based on not the initial speed, but the speed when last timer event triggered.
For example, the initial speed is 20mi/hr. To avoid clash, I calculate certain distance every 20 times a second. While the distance is too close, one car keep speeding up 20 percent and the other car keep slowing down 20 percent. So one car could speed up to 20 + 20*0.2 = 24mi/hr, 24 + 24*0.2 = 28.2mi/hr, (I need to know the current speed is 24) 28.2 + 28.2 *0.2 = 34.56mi/hr, (I need to know the current speed is 28.2) and so on; and the other car could slow down to 20 - 20*0.2 = 16mi/hr, 16 - 16*0.2 = 12.8mi/hr, (I need to know the current speed is 16) 12.8 - 12.8*0.2 = 10.24mi/hr, (I need to know the current speed is 12.8) and so on. Sorry about the trivial details. Do you think it is feasible? Thanks a lot! |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Real Time Audio Data | lomendil | Vizard | 2 | 06-02-2008 09:18 PM |
| Can I get real time Intersense tracking data from another computer on the network? | GoldenSun | Vizard | 4 | 04-30-2008 08:42 PM |
| timer question | Elittdogg | Vizard | 5 | 10-10-2007 03:49 PM |
| Animation Path | djdesmangles | Vizard | 2 | 06-11-2007 04:37 PM |
| Animation Path | djdesmangles | Vizard | 0 | 06-06-2007 12:03 PM |