]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaks so that Jon's FDM stuff get's initialized better.
authorcurt <curt>
Sat, 31 Jul 1999 04:58:26 +0000 (04:58 +0000)
committercurt <curt>
Sat, 31 Jul 1999 04:58:26 +0000 (04:58 +0000)
src/Main/fg_init.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/options.hxx

index cecf5d65474d6431922898ed38e37b7b43f195f8..23b2f9a39fa37b6957ceeb68b02983896d6cbdaa 100644 (file)
@@ -314,7 +314,9 @@ bool fgInitSubsystems( void ) {
     // and should really be read in from one or more files.
 
     // Initial Velocity
-    f->set_Velocities_Local( 0.0, 0.0, 0.0 );
+    f->set_Velocities_Local( current_options.get_uBody(),
+                             current_options.get_vBody(),
+                             current_options.get_wBody());
 
     // Initial Orientation
     f->set_Euler_Angles( current_options.get_roll() * DEG_TO_RAD,
@@ -508,7 +510,9 @@ void fgReInitSubsystems( void )
     // and should really be read in from one or more files.
 
     // Initial Velocity
-    f->set_Velocities_Local( 0.0, 0.0, 0.0 );
+    f->set_Velocities_Local( current_options.get_uBody(),
+                             current_options.get_vBody(),
+                             current_options.get_wBody());
 
     // Initial Orientation
     f->set_Euler_Angles( current_options.get_roll() * DEG_TO_RAD,
index 894294f6cc74ce5a884134b86ee4fcc2c8535d08..43c998fba2d32349e69f5d21063c574485e35754 100644 (file)
@@ -407,6 +407,10 @@ static void fgRenderFrame( void ) {
 
        sgMat4 sgVIEW;
 
+       while ( current_view.follow.size() > 400 ) {
+           current_view.follow.pop_front();
+       }
+
        if ( current_view.view_mode == FGView::FG_VIEW_FIRST_PERSON ) {
            // select current view matrix
            sgCopyMat4( sgVIEW, current_view.sgVIEW );
@@ -417,9 +421,6 @@ static void fgRenderFrame( void ) {
            // select view matrix from front of view matrix queue
            FGMat4Wrapper tmp = current_view.follow.front();
            sgCopyMat4( sgVIEW, tmp.m );
-           while ( current_view.follow.size() > 40 ) {
-               current_view.follow.pop_front();
-           }
 
            // enable TuX and set up his position and orientation
            penguin_sel->select(1);
@@ -1129,7 +1130,8 @@ int main( int argc, char **argv ) {
     penguin_sel = new ssgSelector;
     penguin_pos = new ssgTransform;
 
-    ssgEntity *tux_obj = ssgLoadAC( "glider.ac" );
+    // ssgEntity *tux_obj = ssgLoadAC( "glider.ac" );
+    ssgEntity *tux_obj = ssgLoadAC( "Tower1x.ac" );
     penguin_pos->addKid( tux_obj );
     penguin_sel->addKid( penguin_pos );
     ssgFlatten( tux_obj );
index 89abbfc4f8c59dbca3025a47c52428f08e470036..48bfe14ae076e3a1037a742c9713701c652a0781 100644 (file)
@@ -138,6 +138,9 @@ fgOPTIONS::fgOPTIONS() :
     // if it is lower than the terrain
     altitude(-9999.0),
 
+    // Initialize current options velocities to 0.0
+    uBody(0.0), vBody(0.0), wBody(0.0),
+
     // Initial Orientation
     heading(270.0),      // heading (yaw) angle in degress (Psi)
     roll(0.0),           // roll angle in degrees (Phi)
@@ -592,6 +595,24 @@ int fgOPTIONS::parse_option( const string& arg ) {
        } else {
            altitude = atof( arg.substr(11) );
        }
+    } else if ( arg.find( "--uBody=" ) != string::npos ) {
+       if ( units == FG_UNITS_FEET ) {
+           uBody = atof( arg.substr(8) ) * FEET_TO_METER;
+       } else {
+           uBody = atof( arg.substr(8) );
+       }
+    } else if ( arg.find( "--vBody=" ) != string::npos ) {
+       if ( units == FG_UNITS_FEET ) {
+           vBody = atof( arg.substr(8) ) * FEET_TO_METER;
+       } else {
+           vBody = atof( arg.substr(8) );
+       }
+    } else if ( arg.find( "--wBody=" ) != string::npos ) {
+       if ( units == FG_UNITS_FEET ) {
+           wBody = atof( arg.substr(8) ) * FEET_TO_METER;
+       } else {
+           wBody = atof( arg.substr(8) );
+       }
     } else if ( arg.find( "--heading=" ) != string::npos ) {
        heading = atof( arg.substr(10) );
     } else if ( arg.find( "--roll=" ) != string::npos ) {
@@ -775,6 +796,10 @@ void fgOPTIONS::usage ( void ) {
     printf("\t--heading=degrees:  heading (yaw) angle in degress (Psi)\n");
     printf("\t--roll=degrees:  roll angle in degrees (Phi)\n");
     printf("\t--pitch=degrees:  pitch angle in degrees (Theta)\n");
+    printf("\t--uBody=feet per second:  velocity along the body X axis\n");
+    printf("\t--vBody=feet per second:  velocity along the body Y axis\n");
+    printf("\t--wBody=feet per second:  velocity along the body Z axis\n");
+    printf("\t\t(unless --units-meters specified\n");
     printf("\n");
 
     printf("Rendering Options:\n");
index cb20dcc28fb5f9bf40d98352a67aa6c2f440098d..576d75cc3f9be227bc0fd694ae406112a49fc1f3 100644 (file)
@@ -100,6 +100,9 @@ private:
     double heading;     // heading (yaw) angle in degress (Psi)
     double roll;        // roll angle in degrees (Phi)
     double pitch;       // pitch angle in degrees (Theta)
+    double uBody;       // Body axis X velocity (U)
+    double vBody;       // Body axis Y velocity (V)
+    double wBody;       // Body axis Z velocity (W)
 
     // Miscellaneous
     bool game_mode;     // Game mode enabled/disabled
@@ -181,6 +184,9 @@ public:
     inline double get_heading() const { return heading; }
     inline double get_roll() const { return roll; }
     inline double get_pitch() const { return pitch; }
+    inline double get_uBody() const {return uBody;}
+    inline double get_vBody() const {return vBody;}
+    inline double get_wBody() const {return wBody;}
     inline bool get_game_mode() const { return game_mode; }
     inline bool get_splash_screen() const { return splash_screen; }
     inline bool get_intro_music() const { return intro_music; }