]> git.mxchange.org Git - flightgear.git/blob - src/Aircraft/aircraft.cxx
Set up the model view matrix exactly as ssg does it before drawing sky, stars
[flightgear.git] / src / Aircraft / aircraft.cxx
1 // aircraft.cxx -- various aircraft routines
2 //
3 // Written by Curtis Olson, started May 1997.
4 //
5 // Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22
23
24 #include <stdio.h>
25
26 #include "aircraft.hxx"
27 #include <Debug/logstream.hxx>
28 #include <Include/fg_constants.h>
29
30 // This is a record containing all the info for the aircraft currently
31 // being operated
32 fgAIRCRAFT current_aircraft;
33
34
35 // Initialize an Aircraft structure
36 void fgAircraftInit( void ) {
37     FG_LOG( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure" );
38
39     current_aircraft.fdm_state   = &cur_fdm_state;
40     current_aircraft.controls = &controls;
41 }
42
43
44 // Display various parameters to stdout
45 void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
46     FGInterface *f;
47
48     f = a->fdm_state;
49
50     FG_LOG( FG_FLIGHT, FG_DEBUG,
51             "Pos = ("
52             << (f->get_Longitude() * 3600.0 * RAD_TO_DEG) << "," 
53             << (f->get_Latitude()  * 3600.0 * RAD_TO_DEG) << ","
54             << f->get_Altitude() 
55             << ")  (Phi,Theta,Psi)=("
56             << f->get_Phi() << "," 
57             << f->get_Theta() << "," 
58             << f->get_Psi() << ")" );
59
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 ) );
66 }
67
68