]> git.mxchange.org Git - flightgear.git/commitdiff
Fixes for default chase view values.
authorcurt <curt>
Tue, 5 Feb 2002 23:02:16 +0000 (23:02 +0000)
committercurt <curt>
Tue, 5 Feb 2002 23:02:16 +0000 (23:02 +0000)
src/GUI/sgVec3Slider.cxx
src/GUI/sgVec3Slider.hxx

index 41223728195f49aaea59e319a0b25bbe1c98aaf7..3ef12ba16961a3734ad57012999fcee33dc84c3b 100644 (file)
@@ -286,8 +286,7 @@ sgVec3Slider::sgVec3Slider ( int x, int y, sgVec3 vec, const char *title,
         dialer_x = dialer_x + 170;
 
         /* pitch */
-        // HS1 = new FloatDial (  dialer_x, dialer_y, dialer_size, vec[1], Ytitle, 89.99f, -89.99f );
-       HS1 = new FloatDial (  dialer_x, dialer_y, dialer_size, vec[1], Ytitle, 179.99f, -179.99f );
+       HS1 = new FloatDial (  dialer_x, dialer_y, dialer_size, vec[1], Ytitle, 89.99f, -89.99f );
 
         /* radius */
        HS2 = new FloatSlider (  slider_x, slider_y, slider_width, vec[2], Ztitle, 100.0f, 0.0f );
@@ -367,6 +366,7 @@ void PilotOffsetInit() {
                fgGetFloat("/sim/view[1]/default/pilot-offset/pitch-deg"),
                fgGetFloat("/sim/view[1]/default/pilot-offset/radius-m")
         );
+
        PilotOffsetInit(v);
 }
 
@@ -374,8 +374,16 @@ void PilotOffsetInit( sgVec3 vec )
 {
        // Only one of these things for now
        if( PO_vec == 0 ) {
-               sgVec3Slider *PO = new sgVec3Slider ( 200, 200, vec, "Pilot Offset" );
+                /* make change so this gets done once for each vector */
+                fgSetFloat("/sim/view[1]/current/pilot-offset/heading-deg",fgGetFloat("/sim/view[1]/default/pilot-offset/heading-deg"));
+                fgSetFloat("/sim/view[1]/current/pilot-offset/pitch-deg",fgGetFloat("/sim/view[1]/default/pilot-offset/pitch-deg"));
+                fgSetFloat("/sim/view[1]/current/pilot-offset/radius-m",fgGetFloat("/sim/view[1]/default/pilot-offset/radius-m"));
+               sgVec3Slider *PO = new sgVec3Slider ( 200, 200, vec, "Pilot Offset" );
                PO_vec = PO;
+               // Bindings for Pilot Offset
+                fgTie("/sim/view[1]/current/pilot-offset/heading-deg", getPilotOffsetHeadingDeg, setPilotOffsetHeadingDeg);
+                fgTie("/sim/view[1]/current/pilot-offset/pitch-deg", getPilotOffsetPitchDeg, setPilotOffsetPitchDeg);
+                fgTie("/sim/view[1]/current/pilot-offset/radius-m", getPilotOffsetRadiusM, setPilotOffsetRadiusM);
        }
 }
 
index 0d694a2e2a45261d48d5d9b45b74ab42471c535c..448b830d1d7eb6d7d6375c56e9c45bfb9b606320 100644 (file)
@@ -24,3 +24,44 @@ void PilotOffsetSet( int opt, float setting);
 float PilotOffsetGetSetting( int opt );
 
 #endif // _VEC3_SLIDER_H
+
+/* binding functions for chase view offset */
+
+static void
+setPilotOffsetHeadingDeg (float value)
+{
+       PilotOffsetSet(0, value);
+}
+
+static float
+getPilotOffsetHeadingDeg ()
+{
+       return( PilotOffsetGetSetting(0) );
+}
+
+
+static void
+setPilotOffsetPitchDeg (float value)
+{
+       PilotOffsetSet(1, value);
+}
+
+static float
+getPilotOffsetPitchDeg ()
+{
+       return( PilotOffsetGetSetting(1) );
+}
+
+
+static void
+setPilotOffsetRadiusM (float value)
+{
+       PilotOffsetSet(2, value);
+}
+
+static float
+getPilotOffsetRadiusM ()
+{
+       return( PilotOffsetGetSetting(2) );
+}
+