1 // viewer_rph.hxx -- class for managing a Roll/Pitch/Heading viewer in
2 // the flightgear world.
4 // Written by Curtis Olson, started August 1997.
5 // overhaul started October 2000.
7 // Copyright (C) 1997 - 2000 Curtis L. Olson - curt@flightgear.org
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #ifndef _VIEWER_RPH_HXX
27 #define _VIEWER_RPH_HXX
31 # error This library requires C++
38 // Define a structure containing view information
39 class FGViewerRPH: public FGViewer {
43 // view orientation (roll, pitch, heading)
46 // up vector for the view (usually point straight up through the
47 // top of the aircraft
50 // the vector pointing straight out the nose of the aircraft
53 // Transformation matrix for the view direction offset relative to
54 // the AIRCRAFT matrix
57 // sg versions of our friendly matrices
58 sgMat4 LOCAL, TRANS, LARC_TO_SSG;
60 // Update the view volume, position, and orientation
71 // Initialize a view class
74 //////////////////////////////////////////////////////////////////////
76 //////////////////////////////////////////////////////////////////////
77 inline void set_rph( double r, double p, double h ) {
78 // data should be in radians
80 sgSetVec3( rph, r, p, h );
83 //////////////////////////////////////////////////////////////////////
85 //////////////////////////////////////////////////////////////////////
86 inline float *get_rph() { return rph; }
87 inline float *get_view_forward() { return view_forward; }
88 inline float *get_view_up() { return view_up; }
90 //////////////////////////////////////////////////////////////////////
91 // derived values accessor functions
92 //////////////////////////////////////////////////////////////////////
96 #endif // _VIEWER_RPH_HXX