1
0
Fork 0

Minimize impact of distant AI models on the scene graph.

This commit is contained in:
durk 2008-12-10 16:04:10 +00:00
parent a6909b4ada
commit 1fdac74f8e
2 changed files with 21 additions and 0 deletions

View file

@ -159,8 +159,28 @@ void FGAIAircraft::setPerformance(const std::string& acclass) {
updateSecondaryTargetValues(); // target roll, vertical speed, pitch updateSecondaryTargetValues(); // target roll, vertical speed, pitch
updateActualState(); updateActualState();
UpdateRadar(manager); UpdateRadar(manager);
checkVisibility();
} }
void FGAIAircraft::checkVisibility()
{
double visibility_meters = fgGetDouble("/environment/visibility-m");
FGViewer* vw = globals->get_current_view();
double course, distance;
SGWayPoint current(pos.getLongitudeDeg(), pos.getLatitudeDeg(), 0);
SGWayPoint view (vw->getLongitude_deg(), vw->getLatitude_deg(), 0);
view.CourseAndDistance(current, &course, &distance);
if (distance > visibility_meters) {
//aip.getSGLocation()->set_cur_elev_m(aptElev);
//return;
invisible = true;
} else {
invisible = false;
}
}
void FGAIAircraft::AccelTo(double speed) { void FGAIAircraft::AccelTo(double speed) {

View file

@ -126,6 +126,7 @@ private:
void updatePitchAngleTarget(); void updatePitchAngleTarget();
void updateActualState(); void updateActualState();
void handleATCRequests(); void handleATCRequests();
void checkVisibility();
double sign(double x); double sign(double x);