Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function calculateTrackSpeedR(param1:Track, param2:Number) : void
- {
- var k_V:int =
- var k_aV:int =
- var linearMovementDirection:int = // -1 0 +1
- var angularMovementDirection:int = // -1 0 +1
- var moduleV:int = // Модуль текущей скорости танка
- var moduleaV:int = // Модуль текущей угловой скорости танка
- var rightTrackSpeed:Number = 0;
- if((linearMovementDirection != 0) && (angularMovementDirection == 0))
- {
- rightTrackSpeed = linearMovementDirection * k_V * moduleV;
- }
- else if((linearMovementDirection == 0) && (angularMovementDirection != 0))
- {
- rightTrackSpeed = -angularMovementDirection * k_aV * moduleaV;
- }
- else if((linearMovementDirection != 0) && (angularMovementDirection < 0))
- {
- rightTrackSpeed = (3 / 4) * linearMovementDirection * k_V * moduleV;
- }
- else if((linearMovementDirection != 0) && (angularMovementDirection > 0))
- {
- rightTrackSpeed = (4 / 3) * linearMovementDirection * k_V * moduleV;
- }
- else
- {
- rightTrackSpeed = 0;
- }
- if(moduleV < minSpeed)
- {
- rightTrackSpeed = 0.05 * rightTrackSpeed
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement