]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Tweaks so that Jon's FDM stuff get's initialized better.
[flightgear.git] / src / Main / main.cxx
index 254f8595fcb21cdb497d2701f7361a9a53ead7df..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() > 10 ) {
-               current_view.follow.pop_front();
-           }
 
            // enable TuX and set up his position and orientation
            penguin_sel->select(1);
@@ -430,11 +431,16 @@ static void fgRenderFrame( void ) {
                             current_view.view_pos.y(),
                             current_view.view_pos.z() );
 
-           // sgMat4 sgTMP;
+           sgVec3 ownship_up;
+           sgSetVec3( ownship_up, 0.0, 0.0, 1.0);
+
+           sgMat4 sgROT;
+           sgMakeRotMat4( sgROT, -90.0, ownship_up );
+
+           sgMat4 sgTMP;
            sgMat4 sgTUX;
-           // sgMultMat4( sgTMP, current_view.sgUP, sgTRANS );
-           // sgMultMat4( sgTUX, current_view.sgLARC_TO_SSG, sgTMP );
-           sgMultMat4( sgTUX, current_view.sgVIEW_ROT, sgTRANS );
+           sgMultMat4( sgTMP, sgROT, current_view.sgVIEW_ROT );
+           sgMultMat4( sgTUX, sgTMP, sgTRANS );
        
            sgCoord tuxpos;
            sgSetCoord( &tuxpos, sgTUX );
@@ -495,7 +501,7 @@ void fgUpdateTimeDepCalcs(int multi_loop, int remainder) {
 
        // printf("updating flight model x %d\n", multi_loop);
        fgFDMUpdate( current_options.get_flight_model(), 
-                    cur_fdm_state, multi_loop, remainder );
+                    cur_fdm_state, multi_loop * 1, remainder );
     } else {
        fgFDMUpdate( current_options.get_flight_model(), 
                     cur_fdm_state, 0, remainder );
@@ -1107,10 +1113,16 @@ int main( int argc, char **argv ) {
     // distribution) specifically from the ssg tux example
     //
 
-    // ssgModelPath( "/stage/pinky01/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
-    // ssgTexturePath( "/stage/pinky01/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
-    ssgModelPath( "/h/curt/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
-    ssgTexturePath( "/h/curt/src/Libs/plib-1.0.12/examples/ssg/tux/data/" );
+    FGPath modelpath( current_options.get_fg_root() );
+    modelpath.append( "Models" );
+    modelpath.append( "Geometry" );
+  
+    FGPath texturepath( current_options.get_fg_root() );
+    texturepath.append( "Models" );
+    texturepath.append( "Textures" );
+  
+    ssgModelPath( (char *)modelpath.c_str() );
+    ssgTexturePath( (char *)texturepath.c_str() );
 
     scene = new ssgRoot;
     terrain = new ssgBranch;
@@ -1118,7 +1130,8 @@ int main( int argc, char **argv ) {
     penguin_sel = new ssgSelector;
     penguin_pos = new ssgTransform;
 
-    ssgEntity *tux_obj = ssgLoadAC( "tuxedo.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 );