1 // viewer_lookat.hxx -- class for managing a "look at" viewer in
2 // the flightgear world.
4 // Written by Curtis Olson, started October 2000.
6 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #ifndef _VIEWER_LOOKAT_HXX
26 #define _VIEWER_LOOKAT_HXX
30 # error This library requires C++
37 // Define a structure containing view information
38 class FGViewerLookAt: public FGViewer {
42 // up vector for the view (usually point straight up through the
43 // top of the aircraft
46 // the vector pointing straight out the nose of the aircraft
49 // Transformation matrix for the view direction offset relative to
50 // the AIRCRAFT matrix
53 // sg versions of our friendly matrices
54 sgMat4 LOCAL, TRANS, LARC_TO_SSG;
56 // Update the view volume, position, and orientation
62 FGViewerLookAt( void );
65 ~FGViewerLookAt( void );
67 // Initialize a view class
70 //////////////////////////////////////////////////////////////////////
72 //////////////////////////////////////////////////////////////////////
73 inline void set_view_forward( sgVec3 vf ) {
75 sgCopyVec3( view_forward, vf );
77 inline void set_view_up( sgVec3 vf ) {
79 sgCopyVec3( view_up, vf );
82 //////////////////////////////////////////////////////////////////////
84 //////////////////////////////////////////////////////////////////////
85 inline float *get_view_forward() { return view_forward; }
86 inline float *get_view_up() { return view_up; }
88 //////////////////////////////////////////////////////////////////////
89 // derived values accessor functions
90 //////////////////////////////////////////////////////////////////////
94 #endif // _VIEWER_LOOKAT_HXX