1
0
Fork 0

Added differential braking (Alex and David).

This commit is contained in:
curt 2000-06-12 20:52:36 +00:00
parent 2d4cd1b24d
commit dcdd61c590
5 changed files with 30 additions and 7 deletions

View file

@ -91,7 +91,8 @@ int FGLaRCsim::update( int multiloop ) {
Rudder_pedal = controls.get_rudder();
Flap_handle = 30.0 * controls.get_flaps();
Throttle_pct = controls.get_throttle( 0 ) * 1.0;
Brake_pct = controls.get_brake( 0 );
Brake_pct[0] = controls.get_brake( 1 );
Brake_pct[1] = controls.get_brake( 0 );
// Inform LaRCsim of the local terrain altitude
Runway_altitude = get_Runway_altitude();

View file

@ -36,6 +36,9 @@
$Header$
$Log$
Revision 1.15 2000/06/12 18:52:37 curt
Added differential braking (Alex and David).
Revision 1.14 2000/04/10 18:09:41 curt
David Megginson made a few (mostly minor) mods to the LaRCsim files, and
it's now possible to choose the LaRCsim model at runtime, as in
@ -220,8 +223,8 @@ char gear_strings[NUM_WHEELS][12]={"nose","right main", "left main", "tail skid"
* Put aircraft specific executable code here
*/
percent_brake[1] = Brake_pct; /* replace with cockpit brake handle connection code */
percent_brake[2] = percent_brake[1];
percent_brake[1] = Brake_pct[0];
percent_brake[2] = Brake_pct[1];
caster_angle_rad[0] = 0.52*Rudder_pedal;

View file

@ -35,6 +35,9 @@
$Header$
$Log$
Revision 1.3 2000/06/12 18:52:37 curt
Added differential braking (Alex and David).
Revision 1.2 1999/10/29 16:08:32 curt
Added flaps support to c172 model.
@ -92,7 +95,7 @@ typedef struct {
short left_pb_on_stick, right_pb_on_stick, trig_pos_1, trig_pos_2;
short sb_extend, sb_retract, gear_sel_up;
float throttle_pct;
float brake_pct;
float brake_pct[2];
} COCKPIT;
extern COCKPIT cockpit_;

View file

@ -36,6 +36,9 @@
$Header$
$Log$
Revision 1.3 2000/06/12 18:52:37 curt
Added differential braking (Alex and David).
Revision 1.2 2000/04/10 18:09:41 curt
David Megginson made a few (mostly minor) mods to the LaRCsim files, and
it's now possible to choose the LaRCsim model at runtime, as in
@ -235,9 +238,8 @@ char rcsid[] = "$Id$";
* Put aircraft specific executable code here
*/
/* replace with cockpit brake handle connection code */
percent_brake[1] = Brake_pct;
percent_brake[2] = percent_brake[1];
percent_brake[1] = Brake_pct[0];
percent_brake[2] = Brake_pct[1];
caster_angle_rad[0] = 0.03*Rudder_pedal;

View file

@ -324,6 +324,20 @@ void GLUTkey(unsigned char k, int x, int y) {
b_set = double(!b_ret);
controls.set_brake( FGControls::ALL_WHEELS, b_set);
return;
case 44: // , key
if (controls.get_brake(0) > 0.0) {
controls.set_brake(0, 0.0);
} else {
controls.set_brake(0, 1.0);
}
return;
case 46: // . key
if (controls.get_brake(1) > 0.0) {
controls.set_brake(1, 0.0);
} else {
controls.set_brake(1, 1.0);
}
return;
case 104: // h key
HUD_masterswitch( true );
return;