]> git.mxchange.org Git - flightgear.git/blob - Controls/controls.hxx
79550732e3788d0c7349808e64e0976592057c4a
[flightgear.git] / Controls / controls.hxx
1 // controls.hxx -- defines a standard interface to all flight sim controls
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 // (Log is kept at end of this file)
23
24
25 #ifndef _CONTROLS_HXX
26 #define _CONTROLS_HXX
27
28
29 #include <Include/fg_limits.h>
30
31
32 #ifndef __cplusplus                                                          
33 # error This library requires C++
34 #endif                                   
35
36
37 // Define a structure containing the control parameters
38
39 typedef struct {
40     double aileron;
41     double elevator;
42     double elevator_trim;
43     double rudder;
44     double throttle[FG_MAX_ENGINES];
45     double brake_amt;
46 } fgCONTROLS, *pfgControls;
47
48
49 #define FG_Elevator     c->elevator
50 #define FG_Aileron      c->aileron
51 #define FG_Rudder       c->rudder
52 #define FG_Throttle     c->throttle
53 #define FG_Throttle_All -1
54 #define FG_Elev_Trim    c->elevator_trim
55 #define FG_Brake_Amt    c->brake_amt
56
57 /* 
58 #define Left_button     cockpit_.left_pb_on_stick
59 #define Right_button    cockpit_.right_pb_on_stick
60 #define First_trigger   cockpit_.trig_pos_1
61 #define Second_trigger  cockpit_.trig_pos_2
62 #define Left_trim       cockpit_.left_trim
63 #define Right_trim      cockpit_.right_trim
64 #define SB_extend       cockpit_.sb_extend
65 #define SB_retract      cockpit_.sb_retract
66 #define Gear_sel_up     cockpit_.gear_sel_up 
67 */
68
69
70 extern fgCONTROLS cur_control_params;
71
72 void fgControlsInit( void );
73
74 void fgElevMove(double amt);
75 void fgElevSet(double pos);
76 void fgElevTrimMove(double amt);
77 void fgElevTrimSet(double pos);
78 void fgAileronMove(double amt);
79 void fgAileronSet(double pos);
80 void fgRudderMove(double amt);
81 void fgRudderSet(double pos);
82 void fgThrottleMove(int engine, double amt);
83 void fgThrottleSet(int engine, double pos);
84 void fgBrakeSet( double brake_amt );
85 double fgBrakeGet( void );
86
87
88 #endif // _CONTROLS_HXX
89
90
91 // $Log$
92 // Revision 1.1  1998/10/18 01:51:07  curt
93 // c++-ifying ...
94 //
95 // Revision 1.17  1998/09/29 14:57:00  curt
96 // c++-ified some comments.
97 //
98 // Revision 1.16  1998/09/29 02:01:32  curt
99 // Added a brake.
100 //
101 // Revision 1.15  1998/04/25 22:06:27  curt
102 // Edited cvs log messages in source files ... bad bad bad!
103 //
104 // Revision 1.14  1998/04/22 13:26:19  curt
105 // C++ - ifing the code a bit.
106 //
107 // Revision 1.13  1998/04/21 17:02:35  curt
108 // Prepairing for C++ integration.
109 //
110 // Revision 1.12  1998/02/09 22:56:48  curt
111 // Removed "depend" files from cvs control.  Other minor make tweaks.
112 //
113 // Revision 1.11  1998/02/07 15:29:36  curt
114 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
115 // <chotchkiss@namg.us.anritsu.com>
116 //
117 // Revision 1.10  1998/01/27 00:47:52  curt
118 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
119 // system and commandline/config file processing code.
120 //
121 // Revision 1.9  1998/01/22 02:59:31  curt
122 // Changed #ifdef FILE_H to #ifdef _FILE_H
123 //
124 // Revision 1.8  1998/01/19 18:40:22  curt
125 // Tons of little changes to clean up the code and to remove fatal errors
126 // when building with the c++ compiler.
127 //
128 // Revision 1.7  1997/12/15 23:54:36  curt
129 // Add xgl wrappers for debugging.
130 // Generate terrain normals on the fly.
131 //
132 // Revision 1.6  1997/12/10 22:37:41  curt
133 // Prepended "fg" on the name of all global structures that didn't have it yet.
134 // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
135 //
136 // Revision 1.5  1997/08/27 03:30:02  curt
137 // Changed naming scheme of basic shared structures.
138 //
139 // Revision 1.4  1997/07/23 21:52:18  curt
140 // Put comments around the text after an #endif for increased portability.
141 //
142 // Revision 1.3  1997/05/31 19:16:27  curt
143 // Elevator trim added.
144 //
145 // Revision 1.2  1997/05/23 15:40:33  curt
146 // Added GNU copyright headers.
147 //
148 // Revision 1.1  1997/05/16 15:59:48  curt
149 // Initial revision.
150 //