1
0
Fork 0

Fix a bug in ground elevation measuring for the first frame after we cross

a tile boundary.  (Potentially imposes a slight performance penalty, but
getting the correct answer needs to be higher priority than getting the
wrong answer really quickly.)
This commit is contained in:
curt 2002-10-17 15:54:31 +00:00
parent a01f92f0d1
commit 7df3da668c

View file

@ -403,16 +403,17 @@ int FGTileMgr::update( double lon, double lat, double visibility_meters,
// no reason to update this if we haven't moved...
if ( longitude != last_longitude || latitude != last_latitude ) {
// update current elevation...
if (updateCurrentElevAtPos(abs_pos_vector, center)) {
if ( updateCurrentElevAtPos( abs_pos_vector, center )
)
/*if ( updateCurrentElevAtPos( abs_pos_vector,
globals->get_scenery()->get_next_center() )
)*/
{
last_longitude = longitude;
last_latitude = latitude;
}
}
#if 0
}
#endif
return 1;
}
@ -457,11 +458,11 @@ int FGTileMgr::updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center) {
bool hit = false;
if ( fabs(sc[0]) > 1.0 || fabs(sc[1]) > 1.0 || fabs(sc[2]) > 1.0 ) {
// scenery center has been properly defined so any hit
// should be valid (and not just luck)
// scenery center has been properly defined so any hit should
// be valid (and not just luck)
hit = fgCurrentElev(abs_pos_vector,
sc,
current_tile->get_terra_transform(),
// current_tile->get_terra_transform(),
&hit_list,
&hit_elev,
&hit_radius,
@ -469,6 +470,7 @@ int FGTileMgr::updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center) {
}
if ( hit ) {
// cout << "elev = " << hit_elev << " " << hit_radius << endl;
globals->get_scenery()->set_cur_elev( hit_elev );
globals->get_scenery()->set_cur_radius( hit_radius );
globals->get_scenery()->set_cur_normal( hit_normal );