Everyone knows that ufos can turn on the spot.
Turn on rudder input at low speeds. (Quite useful when using the
ufo fdm for exploring the scenery.)
const double throttle_damp = 0.2;
const double aileron_damp = 0.05;
const double elevator_damp = 0.05;
const double throttle_damp = 0.2;
const double aileron_damp = 0.05;
const double elevator_damp = 0.05;
+const double rudder_damp = 0.4;
FGUFO::FGUFO( double dt )
: Throttle(0.0),
Aileron(0.0),
FGUFO::FGUFO( double dt )
: Throttle(0.0),
Aileron(0.0),
+ Elevator(0.0),
+ Rudder(0.0)
{
// set_delta_t( dt );
}
{
// set_delta_t( dt );
}
+ Aileron * (1 - aileron_damp);
Elevator = globals->get_controls()->get_elevator() * elevator_damp
+ Elevator * (1 - elevator_damp);
+ Aileron * (1 - aileron_damp);
Elevator = globals->get_controls()->get_elevator() * elevator_damp
+ Elevator * (1 - elevator_damp);
+ Rudder = globals->get_controls()->get_rudder() * rudder_damp
+ + Rudder * (1 - rudder_damp);
// the velocity of the aircraft
double velocity = Throttle * 2000; // meters/sec
// the velocity of the aircraft
double velocity = Throttle * 2000; // meters/sec
// angle of turn
double turn_rate = sin(roll) * SGD_PI_4; // radians/sec
double turn = turn_rate * time_step;
// angle of turn
double turn_rate = sin(roll) * SGD_PI_4; // radians/sec
double turn = turn_rate * time_step;
+ double yaw = fabs(Rudder) < .2 ? 0.0 : Rudder / (10 + fabs(speed) * .1);
// update (lon/lat) position
double lat2, lon2, az2;
// update (lon/lat) position
double lat2, lon2, az2;
// update euler angles
_set_Euler_Angles( roll, pitch,
// update euler angles
_set_Euler_Angles( roll, pitch,
- fmod(get_Psi() + turn, SGD_2PI) );
+ fmod(get_Psi() + turn + yaw, SGD_2PI) );
_set_Euler_Rates(0,0,0);
_set_Geocentric_Position( lat_geoc, get_Longitude(),
_set_Euler_Rates(0,0,0);
_set_Geocentric_Position( lat_geoc, get_Longitude(),
double Throttle;
double Aileron;
double Elevator;
double Throttle;
double Aileron;
double Elevator;
public:
FGUFO( double dt );
~FGUFO();
public:
FGUFO( double dt );
~FGUFO();