Minimize impact of distant AI models on the scene graph.
This commit is contained in:
parent
a6909b4ada
commit
1fdac74f8e
2 changed files with 21 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue