Make tile_mgr->prep_ssg_nodes() use an FGLocation object.
This commit is contained in:
parent
9ca42c5fa3
commit
89874fd5f5
4 changed files with 17 additions and 31 deletions
src
|
@ -1208,9 +1208,7 @@ static void fgMainLoop( void ) {
|
||||||
// ...only if location is different than the viewer (to avoid duplicating effort)
|
// ...only if location is different than the viewer (to avoid duplicating effort)
|
||||||
if( acmodel_location != current_view->getFGLocation() ) {
|
if( acmodel_location != current_view->getFGLocation() ) {
|
||||||
if( acmodel_location != 0 ) {
|
if( acmodel_location != 0 ) {
|
||||||
global_tile_mgr.prep_ssg_nodes(visibility_meters,
|
global_tile_mgr.prep_ssg_nodes( acmodel_location, visibility_meters );
|
||||||
acmodel_location->get_world_up(),
|
|
||||||
acmodel_location->get_tile_center());
|
|
||||||
global_tile_mgr.update( acmodel_location->getLongitude_deg(),
|
global_tile_mgr.update( acmodel_location->getLongitude_deg(),
|
||||||
acmodel_location->getLatitude_deg(),
|
acmodel_location->getLatitude_deg(),
|
||||||
visibility_meters,
|
visibility_meters,
|
||||||
|
@ -1229,9 +1227,8 @@ static void fgMainLoop( void ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global_tile_mgr.prep_ssg_nodes(visibility_meters,
|
global_tile_mgr.prep_ssg_nodes( current_view->getFGLocation(),
|
||||||
current_view->getFGLocation()->get_world_up(),
|
visibility_meters );
|
||||||
current_view->getFGLocation()->get_tile_center());
|
|
||||||
// update tile manager for view...
|
// update tile manager for view...
|
||||||
// IMPORTANT!!! the tilemgr update for view location _must_ be done last
|
// 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
|
// after the FDM's until all of Flight Gear code references the viewer's location
|
||||||
|
|
|
@ -591,9 +591,11 @@ bool FGATC610x::do_analog_in() {
|
||||||
// cout << "throttle = " << tmp << endl;
|
// cout << "throttle = " << tmp << endl;
|
||||||
|
|
||||||
// rudder
|
// rudder
|
||||||
|
/*
|
||||||
tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(),
|
tmp = scale( rudder_center->getIntValue(), rudder_min->getIntValue(),
|
||||||
rudder_max->getIntValue(), analog_in_data[10] );
|
rudder_max->getIntValue(), analog_in_data[10] );
|
||||||
fgSetFloat( "/controls/rudder", -tmp );
|
fgSetFloat( "/controls/rudder", -tmp );
|
||||||
|
*/
|
||||||
|
|
||||||
// nav1 volume
|
// nav1 volume
|
||||||
tmp = (float)analog_in_data[25] / 1024.0f;
|
tmp = (float)analog_in_data[25] / 1024.0f;
|
||||||
|
|
|
@ -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
|
// traverse the potentially viewable tile list and update range
|
||||||
// selector and transform
|
// selector and transform
|
||||||
|
|
||||||
// just setup and call new function...
|
Point3D center = location->get_tile_center();
|
||||||
|
float *up = location->get_world_up();
|
||||||
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
|
|
||||||
|
|
||||||
FGTileEntry *e;
|
FGTileEntry *e;
|
||||||
tile_cache.reset_traversal();
|
tile_cache.reset_traversal();
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
# include <simgear/threads/SGQueue.hxx>
|
# include <simgear/threads/SGQueue.hxx>
|
||||||
#endif // ENABLE_THREADS
|
#endif // ENABLE_THREADS
|
||||||
|
|
||||||
|
#include <Main/location.hxx>
|
||||||
|
|
||||||
#include "FGTileLoader.hxx"
|
#include "FGTileLoader.hxx"
|
||||||
#include "hitlist.hxx"
|
#include "hitlist.hxx"
|
||||||
#include "newcache.hxx"
|
#include "newcache.hxx"
|
||||||
|
@ -173,15 +175,14 @@ public:
|
||||||
const sgdVec3 p, const sgdVec3 dir,
|
const sgdVec3 p, const sgdVec3 dir,
|
||||||
FGHitList *list );
|
FGHitList *list );
|
||||||
|
|
||||||
// Prepare the ssg nodes ... for each tile, set it's proper
|
// Prepare the ssg nodes corresponding to each tile. For each
|
||||||
// transform and update it's range selector based on current
|
// tile, set the ssg transform and update it's range selector
|
||||||
// visibilty
|
// based on current visibilty void prep_ssg_nodes( float
|
||||||
void prep_ssg_nodes(float visibility_meters);
|
// visibility_meters );
|
||||||
void prep_ssg_nodes(float visibility_meters, sgVec3 up, Point3D center);
|
void prep_ssg_nodes( FGLocation *location, float visibility_meters );
|
||||||
|
|
||||||
//
|
// Set flag with event manager so that non-moving view refreshes
|
||||||
// Set flag with event manager so that non-moving view refreshes tiles...
|
// tiles...
|
||||||
//
|
|
||||||
void refresh_view_timestamps();
|
void refresh_view_timestamps();
|
||||||
|
|
||||||
inline SGBucket get_current_bucket () { return current_bucket; }
|
inline SGBucket get_current_bucket () { return current_bucket; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue