47 if (_aiWakeData.find(
id) == _aiWakeData.end()) {
50 _aiWakeData[id] = AIWakeData(
new WakeMesh(span, chord,
51 std::string(
"AI:") + ai->
_getName()));
53 SG_LOG(SG_FLIGHT, SG_DEV_ALERT,
54 "Created mesh for " << ai->
_getName() <<
" ID: #" <<
id);
57 AIWakeData& data = _aiWakeData[id];
60 data.position = ai->
getCartPos() * SG_METER_TO_FEET;
61 SGGeoc geoc = SGGeoc::fromCart(data.position);
62 SGQuatd Te2l = SGQuatd::fromLonLatRad(geoc.getLongitudeRad(),
63 geoc.getLatitudeRad());
64 data.Te2b = Te2l * SGQuatd::fromYawPitchRollDeg(ai->
_getHeading(),
67 double hVel = ai->
getSpeed()*SG_KT_TO_FPS;
69 double gamma = atan2(vVel, hVel);
70 double vel = sqrt(hVel*hVel + vVel*vVel);
71 double weight = perfData->
weight();
72 _aiWakeData[id].mesh->computeAoA(vel, _density_slugft->getDoubleValue(),
91 for (
auto it=_aiWakeData.begin(); it != _aiWakeData.end(); ++it) {
92 if (!(*it).second.visited) {
93 SG_LOG(SG_FLIGHT, SG_DEV_ALERT,
"Deleted mesh for aircraft #"
95 _aiWakeData.erase(it);
101 for (
auto &item : _aiWakeData) item.second.visited =
false;