1 // aircraft.cxx -- various aircraft routines
3 // Written by Curtis Olson, started May 1997.
5 // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "aircraft.hxx"
27 #include <Debug/logstream.hxx>
28 #include <Include/fg_constants.h>
30 // This is a record containing all the info for the aircraft currently
32 fgAIRCRAFT current_aircraft;
35 // Initialize an Aircraft structure
36 void fgAircraftInit( void ) {
37 FG_LOG( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure" );
39 current_aircraft.fdm_state = &cur_fdm_state;
40 current_aircraft.controls = &controls;
44 // Display various parameters to stdout
45 void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
50 FG_LOG( FG_FLIGHT, FG_DEBUG,
52 << (f->get_Longitude() * 3600.0 * RAD_TO_DEG) << ","
53 << (f->get_Latitude() * 3600.0 * RAD_TO_DEG) << ","
55 << ") (Phi,Theta,Psi)=("
56 << f->get_Phi() << ","
57 << f->get_Theta() << ","
58 << f->get_Psi() << ")" );
60 FG_LOG( FG_FLIGHT, FG_DEBUG,
61 "Kts = " << f->get_V_equiv_kts()
62 << " Elev = " << controls.get_elevator()
63 << " Aileron = " << controls.get_aileron()
64 << " Rudder = " << controls.get_rudder()
65 << " Power = " << controls.get_throttle( 0 ) );