]> git.mxchange.org Git - flightgear.git/commitdiff
Make tile_mgr->prep_ssg_nodes() use an FGLocation object.
authorcurt <curt>
Thu, 28 Nov 2002 01:08:25 +0000 (01:08 +0000)
committercurt <curt>
Thu, 28 Nov 2002 01:08:25 +0000 (01:08 +0000)
src/Main/main.cxx
src/Network/atc610x.cxx
src/Scenery/tilemgr.cxx
src/Scenery/tilemgr.hxx

index 19d7c934ede8e7afa60bafca60a17c589da4dddc..37508c6243eb3a848a99985ca7e5967e580cf1ff 100644 (file)
@@ -1208,9 +1208,7 @@ static void fgMainLoop( void ) {
     // ...only if location is different than the viewer (to avoid duplicating effort)
     if( acmodel_location != current_view->getFGLocation() ) {
       if( acmodel_location != 0 ) {
-        global_tile_mgr.prep_ssg_nodes(visibility_meters,
-               acmodel_location->get_world_up(),
-               acmodel_location->get_tile_center());
+        global_tile_mgr.prep_ssg_nodes( acmodel_location, visibility_meters );
         global_tile_mgr.update( acmodel_location->getLongitude_deg(),
                            acmodel_location->getLatitude_deg(),
                             visibility_meters,
@@ -1229,9 +1227,8 @@ static void fgMainLoop( void ) {
       }
     }
 
-    global_tile_mgr.prep_ssg_nodes(visibility_meters,
-       current_view->getFGLocation()->get_world_up(),
-       current_view->getFGLocation()->get_tile_center());
+    global_tile_mgr.prep_ssg_nodes( current_view->getFGLocation(),
+                                    visibility_meters );
     // update tile manager for view...
     // IMPORTANT!!! the tilemgr update for view location _must_ be done last 
     // after the FDM's until all of Flight Gear code references the viewer's location
index 4877fbdcc8d303b9432f6bf4b4837da87e7b73b5..18203a6847e73bd90ebb704bc7ef8d47762f65b3 100644 (file)
@@ -591,9 +591,11 @@ bool FGATC610x::do_analog_in() {
     // cout << "throttle = " << tmp << endl;
 
     // rudder
+    /*
     tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(),
                  rudder_max->getIntValue(), analog_in_data[10] );
     fgSetFloat( "/controls/rudder", -tmp );
+    */
 
     // nav1 volume
     tmp = (float)analog_in_data[25] / 1024.0f;
index e969add816d9e15da02cde7519d234e14bcef352..a81cfaeeb0fc2a0a94109c198a6fe2dc4b0d9b4b 100644 (file)
@@ -484,27 +484,13 @@ int FGTileMgr::updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center) {
 }
 
 
-void FGTileMgr::prep_ssg_nodes(float vis) {
+void FGTileMgr::prep_ssg_nodes( FGLocation *location, float vis ) {
 
     // traverse the potentially viewable tile list and update range
     // selector and transform
 
-    // just setup and call new function...
-
-    sgVec3 up;
-    sgCopyVec3( up, globals->get_current_view()->get_world_up() );
-
-    Point3D center;
-    center = globals->get_scenery()->get_center();
-    prep_ssg_nodes( vis, up, center );
-
-}
-
-
-void FGTileMgr::prep_ssg_nodes(float vis, sgVec3 up, Point3D center) {
-
-    // traverse the potentially viewable tile list and update range
-    // selector and transform
+    Point3D center = location->get_tile_center();
+    float *up = location->get_world_up();
 
     FGTileEntry *e;
     tile_cache.reset_traversal();
index d268d4a861d237f71af911892a79c03bd125e0dc..fdda19d58189b9fdd8346893f52edaeddbcfb139 100644 (file)
@@ -41,6 +41,8 @@
 #  include <simgear/threads/SGQueue.hxx>
 #endif // ENABLE_THREADS
 
+#include <Main/location.hxx>
+
 #include "FGTileLoader.hxx"
 #include "hitlist.hxx"
 #include "newcache.hxx"
@@ -173,15 +175,14 @@ public:
                     const sgdVec3 p, const sgdVec3 dir,
                     FGHitList *list );
 
-    // Prepare the ssg nodes ... for each tile, set it's proper
-    // transform and update it's range selector based on current
-    // visibilty
-    void prep_ssg_nodes(float visibility_meters);
-    void prep_ssg_nodes(float visibility_meters, sgVec3 up, Point3D center);
+    // Prepare the ssg nodes corresponding to each tile.  For each
+    // tile, set the ssg transform and update it's range selector
+    // based on current visibilty void prep_ssg_nodes( float
+    // visibility_meters );
+    void prep_ssg_nodes( FGLocation *location, float visibility_meters );
 
-    //
-    // Set flag with event manager so that non-moving view refreshes tiles...
-    //
+    // Set flag with event manager so that non-moving view refreshes
+    // tiles...
     void refresh_view_timestamps();
 
     inline SGBucket get_current_bucket () { return current_bucket; }