From 89874fd5f5be0e910307870490676b93342edaea Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 28 Nov 2002 01:08:25 +0000 Subject: [PATCH] Make tile_mgr->prep_ssg_nodes() use an FGLocation object. --- src/Main/main.cxx | 9 +++------ src/Network/atc610x.cxx | 2 ++ src/Scenery/tilemgr.cxx | 20 +++----------------- src/Scenery/tilemgr.hxx | 17 +++++++++-------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 19d7c934e..37508c624 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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 diff --git a/src/Network/atc610x.cxx b/src/Network/atc610x.cxx index 4877fbdcc..18203a684 100644 --- a/src/Network/atc610x.cxx +++ b/src/Network/atc610x.cxx @@ -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; diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index e969add81..a81cfaeeb 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -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(); diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index d268d4a86..fdda19d58 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -41,6 +41,8 @@ # include #endif // ENABLE_THREADS +#include
+ #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; } -- 2.39.5