* Changes the speed of the moving target * and converts it from standard knots (nautical miles per hour) * into radians per 5 in-game seconds. * @param speed Speed in knots. */
| 132 | * @param speed Speed in knots. |
| 133 | */ |
| 134 | void MovingTarget::setSpeed(int speed) |
| 135 | { |
| 136 | _speed = speed; |
| 137 | // Each nautical mile is 1/60th of a degree. |
| 138 | // Each hour contains 720 5-seconds. |
| 139 | _speedRadian = _speed * (1 / 60.0) * (M_PI / 180) / 720.0; |
| 140 | calculateSpeed(); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Calculates the speed vector based on the |
no outgoing calls
no test coverage detected