1 // FGAIBase - abstract base class for AI objects
2 // Written by David Culp, started Nov 2003, based on
3 // David Luff's FGAIEntity class.
4 // - davidculp2@comcast.net
6 // With additions by Mathias Froehlich & Vivian Meazza 2004 -2007
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include <simgear/compiler.h>
33 #include <osg/ref_ptr>
35 #include <osgDB/FileUtils>
37 #include <simgear/misc/sg_path.hxx>
38 #include <simgear/scene/model/modellib.hxx>
39 #include <simgear/scene/util/SGNodeMasks.hxx>
40 #include <simgear/sound/soundmgr_openal.hxx>
41 #include <simgear/debug/logstream.hxx>
42 #include <simgear/props/props.hxx>
44 #include <Main/globals.hxx>
45 #include <Scenery/scenery.hxx>
46 #include <Scripting/NasalSys.hxx>
47 #include <Sound/fg_fx.hxx>
50 #include "AIManager.hxx"
52 const char *default_model = "Models/Geometry/glider.ac";
53 const double FGAIBase::e = 2.71828183;
54 const double FGAIBase::lbs_to_slugs = 0.031080950172; //conversion factor
56 using namespace simgear;
58 FGAIBase::FGAIBase(object_type ot, bool enableHot) :
63 model_removed( fgGetNode("/ai/models/model-removed", true) ),
74 _refID( _newAIModelID() ),
81 tgt_heading = hdg = tgt_altitude_ft = tgt_speed = 0.0;
82 tgt_roll = roll = tgt_pitch = tgt_yaw = tgt_vs = vs = pitch = 0.0;
83 bearing = elevation = range = rdot = 0.0;
84 x_shift = y_shift = rotation = 0.0;
90 _impact_reported = false;
91 _collision_reported = false;
92 _expiry_reported = false;
104 userpos = SGGeod::fromDeg(0, 0);
106 pos = SGGeod::fromDeg(0, 0);
109 speed_north_deg_sec = 0;
110 speed_east_deg_sec = 0;
130 // explicitly disable HOT for (most) AI models
132 aip.getSceneGraph()->setNodeMask(~SG_NODEMASK_TERRAIN_BIT);
135 FGAIBase::~FGAIBase() {
136 // Unregister that one at the scenery manager
140 SGPropertyNode* parent = props->getParent();
143 model_removed->setStringValue(props->getPath());
146 // refID=0 is supposedley impossible, refID=1 is the special ai_ac aircaft
147 // representing the current user, in the ATCManager. Maybe both these
149 if (_fx && _refID != 0 && _refID != 1) {
150 SGSoundMgr *smgr = globals->get_soundmgr();
155 smgr->remove(name.str());
164 /** Cleanly remove the model
165 * and let the scenery database pager do the clean-up work.
168 FGAIBase::removeModel()
173 FGScenery* pSceneryManager = globals->get_scenery();
176 osg::ref_ptr<osg::Object> temp = _model.get();
177 pSceneryManager->get_scene_graph()->removeChild(aip.getSceneGraph());
178 // withdraw from SGModelPlacement and drop own reference (unref)
181 // pass it on to the pager, to be be deleted in the pager thread
182 pSceneryManager->getPager()->queueDeleteRequest(temp);
186 SG_LOG(SG_AI, SG_ALERT, "AIBase: Could not unload model. Missing scenery manager!");
190 void FGAIBase::readFromScenario(SGPropertyNode* scFileNode)
195 setPath(scFileNode->getStringValue("model",
196 fgGetString("/sim/multiplay/default-model", default_model)));
198 setHeading(scFileNode->getDoubleValue("heading", 0.0));
199 setSpeed(scFileNode->getDoubleValue("speed", 0.0));
200 setAltitude(scFileNode->getDoubleValue("altitude", 0.0));
201 setLongitude(scFileNode->getDoubleValue("longitude", 0.0));
202 setLatitude(scFileNode->getDoubleValue("latitude", 0.0));
203 setBank(scFileNode->getDoubleValue("roll", 0.0));
205 SGPropertyNode* submodels = scFileNode->getChild("submodels");
208 setServiceable(submodels->getBoolValue("serviceable", false));
209 setSMPath(submodels->getStringValue("path", ""));
214 void FGAIBase::update(double dt) {
216 if (_otype == otStatic)
219 if (_otype == otBallistic)
222 ft_per_deg_lat = 366468.96 - 3717.12 * cos(pos.getLatitudeRad());
223 ft_per_deg_lon = 365228.16 * cos(pos.getLatitudeRad());
227 // update model's audio sample values
228 _fx->set_position_geod( pos );
230 SGQuatd orient = SGQuatd::fromYawPitchRollDeg(hdg, pitch, roll);
231 _fx->set_orientation( orient );
234 velocity = SGVec3d( speed_north_deg_sec, speed_east_deg_sec,
236 _fx->set_velocity( velocity );
238 else if ((_modeldata)&&(_modeldata->needInitilization()))
240 // process deferred nasal initialization,
241 // which must be done in main thread
244 // sound initialization
245 if (fgGetBool("/sim/sound/aimodels/enabled",false))
247 string fxpath = _modeldata->get_sound_path();
250 props->setStringValue("sim/sound/path", fxpath.c_str());
252 // initialize the sound configuration
256 _fx = new FGFX(name.str(), props);
263 /** update LOD properties of the model */
264 void FGAIBase::updateLOD()
266 double maxRangeDetail = fgGetDouble("/sim/rendering/static-lod/ai-detailed", 10000.0);
267 double maxRangeBare = fgGetDouble("/sim/rendering/static-lod/ai-bare", 20000.0);
270 if( maxRangeDetail == 0.0 )
273 _model->setRange(0, 0.0, FLT_MAX);
274 _model->setRange(1, FLT_MAX, FLT_MAX);
278 _model->setRange(0, 0.0, maxRangeDetail);
279 _model->setRange(1, maxRangeDetail,maxRangeBare);
284 void FGAIBase::Transform() {
287 aip.setVisible(true);
288 aip.setPosition(pos);
291 aip.setOrientation(0.0, pitch, hdg);
293 aip.setOrientation(roll, pitch, hdg);
297 aip.setVisible(false);
303 bool FGAIBase::init(bool search_in_AI_path)
307 SG_LOG(SG_AI, SG_ALERT, "AIBase: Cannot initialize a model multiple times! " << model_path);
312 if(search_in_AI_path)
314 // setup a modified Options structure, with only the $fg-root/AI defined;
315 // we'll check that first, then give the normal search logic a chance.
316 // this ensures that models in AI/ are preferred to normal models, where
318 osg::ref_ptr<osgDB::ReaderWriter::Options>
319 opt(osg::clone(osgDB::Registry::instance()->getOptions(), osg::CopyOp::SHALLOW_COPY));
321 SGPath ai_path(globals->get_fg_root(), "AI");
322 opt->setDatabasePath(ai_path.str());
324 f = osgDB::findDataFile(model_path, opt.get());
328 f = simgear::SGModelLib::findDataFile(model_path);
332 f = fgGetString("/sim/multiplay/default-model", default_model);
336 _modeldata = new FGAIModelData(props);
337 osg::Node * mdl = SGModelLib::loadDeferredModel(f, props, _modeldata);
339 _model = new osg::LOD;
340 _model->setName("AI-model range animation node");
342 _model->addChild( mdl, 0, FLT_MAX );
343 _model->setCenterMode(osg::LOD::USE_BOUNDING_SPHERE_CENTER);
344 _model->setRangeMode(osg::LOD::DISTANCE_FROM_EYE_POINT);
345 // We really need low-resolution versions of AI/MP aircraft.
346 // Or at least dummy "stubs" with some default silhouette.
347 // _model->addChild( SGModelLib::loadPagedModel(fgGetString("/sim/multiplay/default-model", default_model),
348 // props, new FGNasalModelData(props)), FLT_MAX, FLT_MAX);
352 if (_model.valid() && _initialized == false) {
353 aip.init( _model.get() );
354 aip.setVisible(true);
356 globals->get_scenery()->get_scene_graph()->addChild(aip.getSceneGraph());
359 SG_LOG(SG_AI, SG_DEBUG, "AIBase: Loaded model " << model_path);
361 } else if (!model_path.empty()) {
362 SG_LOG(SG_AI, SG_WARN, "AIBase: Could not load model " << model_path);
363 // not properly installed...
371 void FGAIBase::initModel(osg::Node *node)
373 if (_model.valid()) {
376 props->setStringValue("submodels/path", _path.c_str());
377 SG_LOG(SG_AI, SG_DEBUG, "AIBase: submodels/path " << _path);
381 props->setStringValue("parent-name", _parent.c_str());
384 fgSetString("/ai/models/model-added", props->getPath().c_str());
385 } else if (!model_path.empty()) {
386 SG_LOG(SG_AI, SG_WARN, "AIBase: Could not load model " << model_path);
393 bool FGAIBase::isa( object_type otype ) {
394 return otype == _otype;
398 void FGAIBase::bind() {
399 _tiedProperties.setRoot(props);
400 tie("id", SGRawValueMethods<FGAIBase,int>(*this,
402 tie("velocities/true-airspeed-kt", SGRawValuePointer<double>(&speed));
403 tie("velocities/vertical-speed-fps",
404 SGRawValueMethods<FGAIBase,double>(*this,
405 &FGAIBase::_getVS_fps,
406 &FGAIBase::_setVS_fps));
408 tie("position/altitude-ft",
409 SGRawValueMethods<FGAIBase,double>(*this,
410 &FGAIBase::_getAltitude,
411 &FGAIBase::_setAltitude));
412 tie("position/latitude-deg",
413 SGRawValueMethods<FGAIBase,double>(*this,
414 &FGAIBase::_getLatitude,
415 &FGAIBase::_setLatitude));
416 tie("position/longitude-deg",
417 SGRawValueMethods<FGAIBase,double>(*this,
418 &FGAIBase::_getLongitude,
419 &FGAIBase::_setLongitude));
421 tie("position/global-x",
422 SGRawValueMethods<FGAIBase,double>(*this,
423 &FGAIBase::_getCartPosX,
425 tie("position/global-y",
426 SGRawValueMethods<FGAIBase,double>(*this,
427 &FGAIBase::_getCartPosY,
429 tie("position/global-z",
430 SGRawValueMethods<FGAIBase,double>(*this,
431 &FGAIBase::_getCartPosZ,
434 SGRawValueMethods<FGAIBase,const char*>(*this,
435 &FGAIBase::_getCallsign,
438 tie("orientation/pitch-deg", SGRawValuePointer<double>(&pitch));
439 tie("orientation/roll-deg", SGRawValuePointer<double>(&roll));
440 tie("orientation/true-heading-deg", SGRawValuePointer<double>(&hdg));
442 tie("radar/in-range", SGRawValuePointer<bool>(&in_range));
443 tie("radar/bearing-deg", SGRawValuePointer<double>(&bearing));
444 tie("radar/elevation-deg", SGRawValuePointer<double>(&elevation));
445 tie("radar/range-nm", SGRawValuePointer<double>(&range));
446 tie("radar/h-offset", SGRawValuePointer<double>(&horiz_offset));
447 tie("radar/v-offset", SGRawValuePointer<double>(&vert_offset));
448 tie("radar/x-shift", SGRawValuePointer<double>(&x_shift));
449 tie("radar/y-shift", SGRawValuePointer<double>(&y_shift));
450 tie("radar/rotation", SGRawValuePointer<double>(&rotation));
451 tie("radar/ht-diff-ft", SGRawValuePointer<double>(&ht_diff));
452 tie("subID", SGRawValuePointer<int>(&_subID));
453 tie("controls/lighting/nav-lights", SGRawValueFunctions<bool>(_isNight));
455 props->setBoolValue("controls/lighting/beacon", true);
456 props->setBoolValue("controls/lighting/strobe", true);
457 props->setBoolValue("controls/glide-path", true);
459 props->setStringValue("controls/flight/lateral-mode", "roll");
460 props->setDoubleValue("controls/flight/target-hdg", hdg);
461 props->setDoubleValue("controls/flight/target-roll", roll);
463 props->setStringValue("controls/flight/longitude-mode", "alt");
464 props->setDoubleValue("controls/flight/target-alt", altitude_ft);
465 props->setDoubleValue("controls/flight/target-pitch", pitch);
467 props->setDoubleValue("controls/flight/target-spd", speed);
469 props->setBoolValue("sim/sound/avionics/enabled", false);
470 props->setDoubleValue("sim/sound/avionics/volume", 0.0);
471 props->setBoolValue("sim/sound/avionics/external-view", false);
472 props->setBoolValue("sim/current-view/internal", false);
475 void FGAIBase::unbind() {
476 _tiedProperties.Untie();
478 props->setBoolValue("/sim/controls/radar", true);
480 // drop reference to sound effects now
484 double FGAIBase::UpdateRadar(FGAIManager* manager) {
485 bool control = fgGetBool("/sim/controls/radar", true);
487 if(!control) return 0;
489 double radar_range_ft2 = fgGetDouble("/instrumentation/radar/range");
490 bool force_on = fgGetBool("/instrumentation/radar/debug-mode", false);
491 radar_range_ft2 *= SG_NM_TO_METER * SG_METER_TO_FEET * 1.1; // + 10%
492 radar_range_ft2 *= radar_range_ft2;
494 double user_latitude = manager->get_user_latitude();
495 double user_longitude = manager->get_user_longitude();
496 double lat_range = fabs(pos.getLatitudeDeg() - user_latitude) * ft_per_deg_lat;
497 double lon_range = fabs(pos.getLongitudeDeg() - user_longitude) * ft_per_deg_lon;
498 double range_ft2 = lat_range*lat_range + lon_range*lon_range;
501 // Test whether the target is within radar range.
503 in_range = (range_ft2 && (range_ft2 <= radar_range_ft2));
505 if ( in_range || force_on ) {
506 props->setBoolValue("radar/in-range", true);
508 // copy values from the AIManager
509 double user_altitude = manager->get_user_altitude();
510 double user_heading = manager->get_user_heading();
511 double user_pitch = manager->get_user_pitch();
512 //double user_yaw = manager->get_user_yaw();
513 //double user_speed = manager->get_user_speed();
515 // calculate range to target in feet and nautical miles
516 double range_ft = sqrt( range_ft2 );
517 range = range_ft / 6076.11549;
519 // calculate bearing to target
520 if (pos.getLatitudeDeg() >= user_latitude) {
521 bearing = atan2(lat_range, lon_range) * SG_RADIANS_TO_DEGREES;
522 if (pos.getLongitudeDeg() >= user_longitude) {
523 bearing = 90.0 - bearing;
525 bearing = 270.0 + bearing;
528 bearing = atan2(lon_range, lat_range) * SG_RADIANS_TO_DEGREES;
529 if (pos.getLongitudeDeg() >= user_longitude) {
530 bearing = 180.0 - bearing;
532 bearing = 180.0 + bearing;
536 // This is an alternate way to compute bearing and distance which
537 // agrees with the original scheme within about 0.1 degrees.
539 // Point3D start( user_longitude * SGD_DEGREES_TO_RADIANS,
540 // user_latitude * SGD_DEGREES_TO_RADIANS, 0 );
541 // Point3D dest( pos.getLongitudeRad(), pos.getLatitudeRad(), 0 );
542 // double gc_bearing, gc_range;
543 // calc_gc_course_dist( start, dest, &gc_bearing, &gc_range );
544 // gc_range *= SG_METER_TO_NM;
545 // gc_bearing *= SGD_RADIANS_TO_DEGREES;
546 // printf("orig b = %.3f %.2f gc b= %.3f, %.2f\n",
547 // bearing, range, gc_bearing, gc_range);
549 // calculate look left/right to target, without yaw correction
550 horiz_offset = bearing - user_heading;
551 if (horiz_offset > 180.0) horiz_offset -= 360.0;
552 if (horiz_offset < -180.0) horiz_offset += 360.0;
554 // calculate elevation to target
555 elevation = atan2( altitude_ft - user_altitude, range_ft ) * SG_RADIANS_TO_DEGREES;
557 // calculate look up/down to target
558 vert_offset = elevation - user_pitch;
560 /* this calculation needs to be fixed, but it isn't important anyway
561 // calculate range rate
562 double recip_bearing = bearing + 180.0;
563 if (recip_bearing > 360.0) recip_bearing -= 360.0;
564 double my_horiz_offset = recip_bearing - hdg;
565 if (my_horiz_offset > 180.0) my_horiz_offset -= 360.0;
566 if (my_horiz_offset < -180.0) my_horiz_offset += 360.0;
567 rdot = (-user_speed * cos( horiz_offset * SG_DEGREES_TO_RADIANS ))
568 +(-speed * 1.686 * cos( my_horiz_offset * SG_DEGREES_TO_RADIANS ));
571 // now correct look left/right for yaw
572 // horiz_offset += user_yaw; // FIXME: WHY WOULD WE WANT TO ADD IN SIDE-SLIP HERE?
574 // calculate values for radar display
575 y_shift = range * cos( horiz_offset * SG_DEGREES_TO_RADIANS);
576 x_shift = range * sin( horiz_offset * SG_DEGREES_TO_RADIANS);
577 rotation = hdg - user_heading;
578 if (rotation < 0.0) rotation += 360.0;
579 ht_diff = altitude_ft - user_altitude;
587 * Getters and Setters
590 SGVec3d FGAIBase::getCartPosAt(const SGVec3d& _off) const {
591 // Transform that one to the horizontal local coordinate system.
592 SGQuatd hlTrans = SGQuatd::fromLonLat(pos);
594 // and postrotate the orientation of the AIModel wrt the horizontal
596 hlTrans *= SGQuatd::fromYawPitchRollDeg(hdg, pitch, roll);
598 // The offset converted to the usual body fixed coordinate system
599 // rotated to the earth fixed coordinates axis
600 SGVec3d off = hlTrans.backTransform(_off);
602 // Add the position offset of the AIModel to gain the earth centered position
603 SGVec3d cartPos = SGVec3d::fromGeod(pos);
605 return cartPos + off;
608 SGVec3d FGAIBase::getCartPos() const {
609 SGVec3d cartPos = SGVec3d::fromGeod(pos);
613 bool FGAIBase::getGroundElevationM(const SGGeod& pos, double& elev,
614 const simgear::BVHMaterial** material) const {
615 return globals->get_scenery()->get_elevation_m(pos, elev, material,
619 double FGAIBase::_getCartPosX() const {
620 SGVec3d cartPos = getCartPos();
624 double FGAIBase::_getCartPosY() const {
625 SGVec3d cartPos = getCartPos();
629 double FGAIBase::_getCartPosZ() const {
630 SGVec3d cartPos = getCartPos();
634 void FGAIBase::_setLongitude( double longitude ) {
635 pos.setLongitudeDeg(longitude);
638 void FGAIBase::_setLatitude ( double latitude ) {
639 pos.setLatitudeDeg(latitude);
642 void FGAIBase::_setUserPos(){
643 userpos.setLatitudeDeg(manager->get_user_latitude());
644 userpos.setLongitudeDeg(manager->get_user_longitude());
645 userpos.setElevationM(manager->get_user_altitude() * SG_FEET_TO_METER);
648 void FGAIBase::_setSubID( int s ) {
652 bool FGAIBase::setParentNode() {
655 SG_LOG(SG_AI, SG_ALERT, "AIBase: " << _name
656 << " parent not set ");
660 const SGPropertyNode_ptr ai = fgGetNode("/ai/models", true);
662 for (int i = ai->nChildren() - 1; i >= -1; i--) {
663 SGPropertyNode_ptr model;
665 if (i < 0) { // last iteration: selected model
666 model = _selected_ac;
668 model = ai->getChild(i);
669 string path = ai->getPath();
670 const string name = model->getStringValue("name");
672 if (!model->nChildren()){
675 if (name == _parent) {
676 _selected_ac = model; // save selected model for last iteration
686 if (_selected_ac != 0){
687 const string name = _selected_ac->getStringValue("name");
690 SG_LOG(SG_AI, SG_ALERT, "AIBase: " << _name
691 << " parent not found: dying ");
698 double FGAIBase::_getLongitude() const {
699 return pos.getLongitudeDeg();
702 double FGAIBase::_getLatitude() const {
703 return pos.getLatitudeDeg();
706 double FGAIBase::_getElevationFt() const {
707 return pos.getElevationFt();
710 double FGAIBase::_getRdot() const {
714 double FGAIBase::_getVS_fps() const {
718 double FGAIBase::_get_speed_east_fps() const {
719 return speed_east_deg_sec * ft_per_deg_lon;
722 double FGAIBase::_get_speed_north_fps() const {
723 return speed_north_deg_sec * ft_per_deg_lat;
726 void FGAIBase::_setVS_fps( double _vs ) {
730 double FGAIBase::_getAltitude() const {
734 double FGAIBase::_getAltitudeAGL(SGGeod inpos, double start){
735 getGroundElevationM(SGGeod::fromGeodM(inpos, start),
737 return inpos.getElevationFt() - _elevation_m * SG_METER_TO_FEET;
740 bool FGAIBase::_getServiceable() const {
744 SGPropertyNode* FGAIBase::_getProps() const {
748 void FGAIBase::_setAltitude( double _alt ) {
752 bool FGAIBase::_isNight() {
753 return (fgGetFloat("/sim/time/sun-angle-rad") > 1.57);
756 bool FGAIBase::_getCollisionData() {
757 return _collision_reported;
760 bool FGAIBase::_getExpiryData() {
761 return _expiry_reported;
764 bool FGAIBase::_getImpactData() {
765 return _impact_reported;
768 double FGAIBase::_getImpactLat() const {
772 double FGAIBase::_getImpactLon() const {
776 double FGAIBase::_getImpactElevFt() const {
777 return _impact_elev * SG_METER_TO_FEET;
780 double FGAIBase::_getImpactPitch() const {
781 return _impact_pitch;
784 double FGAIBase::_getImpactRoll() const {
788 double FGAIBase::_getImpactHdg() const {
792 double FGAIBase::_getImpactSpeed() const {
793 return _impact_speed;
796 int FGAIBase::getID() const {
800 int FGAIBase::_getSubID() const {
804 double FGAIBase::_getSpeed() const {
808 double FGAIBase::_getRoll() const {
812 double FGAIBase::_getPitch() const {
816 double FGAIBase::_getHeading() const {
820 double FGAIBase::_getXOffset() const {
824 double FGAIBase::_getYOffset() const {
828 double FGAIBase::_getZOffset() const {
832 const char* FGAIBase::_getPath() const {
833 return model_path.c_str();
836 const char* FGAIBase::_getSMPath() const {
837 return _path.c_str();
840 const char* FGAIBase::_getName() const {
841 return _name.c_str();
844 const char* FGAIBase::_getCallsign() const {
845 return _callsign.c_str();
848 const char* FGAIBase::_getSubmodel() const {
849 return _submodel.c_str();
852 void FGAIBase::CalculateMach() {
853 // Calculate rho at altitude, using standard atmosphere
854 // For the temperature T and the pressure p,
855 double altitude = altitude_ft;
857 if (altitude < 36152) { // curve fits for the troposphere
858 T = 59 - 0.00356 * altitude;
859 p = 2116 * pow( ((T + 459.7) / 518.6) , 5.256);
860 } else if ( 36152 < altitude && altitude < 82345 ) { // lower stratosphere
862 p = 473.1 * pow( e , 1.73 - (0.000048 * altitude) );
863 } else { // upper stratosphere
864 T = -205.05 + (0.00164 * altitude);
865 p = 51.97 * pow( ((T + 459.7) / 389.98) , -11.388);
868 rho = p / (1718 * (T + 459.7));
870 // calculate the speed of sound at altitude
871 // a = sqrt ( g * R * (T + 459.7))
873 // a = speed of sound [ft/s]
874 // g = specific heat ratio, which is usually equal to 1.4
875 // R = specific gas constant, which equals 1716 ft-lb/slug/R
876 a = sqrt ( 1.4 * 1716 * (T + 459.7));
878 // calculate Mach number
881 // cout << "Speed(ft/s) "<< speed <<" Altitude(ft) "<< altitude << " Mach " << Mach << endl;
884 int FGAIBase::_newAIModelID() {
888 id++; // id = 0 is not allowed.
894 FGAIModelData::FGAIModelData(SGPropertyNode *root)
895 : _nasal( new FGNasalModelDataProxy(root) ),
901 FGAIModelData::~FGAIModelData()
907 void FGAIModelData::modelLoaded(const string& path, SGPropertyNode *prop, osg::Node *n)
909 // WARNING: Called in a separate OSG thread! Only use thread-safe stuff here...
913 _fxpath = prop->getStringValue("sound/path");
914 _nasal->modelLoaded(path, prop, n);