// ...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,
}
}
- 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
// 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;
}
-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();
# include <simgear/threads/SGQueue.hxx>
#endif // ENABLE_THREADS
+#include <Main/location.hxx>
+
#include "FGTileLoader.hxx"
#include "hitlist.hxx"
#include "newcache.hxx"
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; }