1
0
Fork 0

Patch from Melchior Franz:

It's cumbersome to use the MagicCarpet as 3D cursor, because everytime
you shoot over the target you have first to turn by 180 degrees and to
fly back.

This patch lets the magic carpet fly backwards if brake[0] is active,
which is by default associated with the joystick's fire button.
This commit is contained in:
david 2002-05-09 21:56:07 +00:00
parent 26e4ae9fc4
commit 5c799d1ba2

View file

@ -56,6 +56,10 @@ void FGMagicCarpet::update( int multiloop ) {
// speed and distance traveled
double speed = globals->get_controls()->get_throttle( 0 ) * 2000; // meters/sec
if ( globals->get_controls()->get_brake( 0 ) ) {
speed = -speed;
}
double dist = speed * time_step;
double kts = speed * SG_METER_TO_NM * 3600.0;
_set_V_equiv_kts( kts );
@ -73,7 +77,7 @@ void FGMagicCarpet::update( int multiloop ) {
// update (lon/lat) position
double lat2, lon2, az2;
if ( speed > SG_EPSILON ) {
if ( fabs( speed ) > SG_EPSILON ) {
geo_direct_wgs_84 ( get_Altitude(),
get_Latitude() * SGD_RADIANS_TO_DEGREES,
get_Longitude() * SGD_RADIANS_TO_DEGREES,