Merge branch 'next' into durk-atc
This commit is contained in:
commit
b603344d69
3 changed files with 16 additions and 16 deletions
|
@ -225,8 +225,22 @@ bool FGAIBase::init(bool search_in_AI_path) {
|
||||||
else
|
else
|
||||||
_installed = true;
|
_installed = true;
|
||||||
|
|
||||||
model = load3DModel(f, props);
|
osg::Node * mdl = SGModelLib::loadPagedModel(f, props, new FGNasalModelData(props));
|
||||||
|
model = mdl;
|
||||||
|
|
||||||
|
double aiModelMaxRange = fgGetDouble("/sim/rendering/static-lod/ai", 0.0);
|
||||||
|
if( aiModelMaxRange > 0.0 ) {
|
||||||
|
osg::LOD * lod = new osg::LOD;
|
||||||
|
lod->setName("AI-model range animation node");
|
||||||
|
|
||||||
|
lod->addChild( mdl, 0, aiModelMaxRange );
|
||||||
|
lod->setCenterMode(osg::LOD::USE_BOUNDING_SPHERE_CENTER);
|
||||||
|
lod->setRangeMode(osg::LOD::DISTANCE_FROM_EYE_POINT);
|
||||||
|
|
||||||
|
model = lod;
|
||||||
|
}
|
||||||
|
|
||||||
|
initModel(mdl);
|
||||||
if (model.valid() && _initialized == false) {
|
if (model.valid() && _initialized == false) {
|
||||||
aip.init( model.get() );
|
aip.init( model.get() );
|
||||||
aip.setVisible(true);
|
aip.setVisible(true);
|
||||||
|
@ -266,13 +280,6 @@ void FGAIBase::initModel(osg::Node *node)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
osg::Node* FGAIBase::load3DModel(const string &path, SGPropertyNode *prop_root)
|
|
||||||
{
|
|
||||||
model = SGModelLib::loadPagedModel(path, prop_root, new FGNasalModelData(prop_root));
|
|
||||||
initModel(model.get());
|
|
||||||
return model.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FGAIBase::isa( object_type otype ) {
|
bool FGAIBase::isa( object_type otype ) {
|
||||||
return otype == _otype;
|
return otype == _otype;
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,9 +300,6 @@ public:
|
||||||
inline double _getRange() { return range; };
|
inline double _getRange() { return range; };
|
||||||
inline double _getBearing() { return bearing; };
|
inline double _getBearing() { return bearing; };
|
||||||
|
|
||||||
virtual osg::Node* load3DModel(const string &path,
|
|
||||||
SGPropertyNode *prop_root);
|
|
||||||
|
|
||||||
static bool _isNight();
|
static bool _isNight();
|
||||||
|
|
||||||
string & getCallSign();
|
string & getCallSign();
|
||||||
|
|
|
@ -184,17 +184,13 @@ void helpCb ()
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
|
|
||||||
// Look for favorite browser
|
// Look for favorite browser
|
||||||
char Dummy[1024], ExecName[1024], browserParameter[1024];
|
|
||||||
char win32_name[1024];
|
char win32_name[1024];
|
||||||
# ifdef __CYGWIN__
|
# ifdef __CYGWIN__
|
||||||
cygwin32_conv_to_full_win32_path(path.c_str(),win32_name);
|
cygwin32_conv_to_full_win32_path(path.c_str(),win32_name);
|
||||||
# else
|
# else
|
||||||
strncpy(win32_name,path.c_str(), 1024);
|
strncpy(win32_name,path.c_str(), 1024);
|
||||||
# endif
|
# endif
|
||||||
Dummy[0] = 0;
|
ShellExecute ( NULL, "open", win32_name, NULL, NULL,
|
||||||
FindExecutable(win32_name, Dummy, ExecName);
|
|
||||||
snprintf(browserParameter, 1024, "file:///%s", win32_name);
|
|
||||||
ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy,
|
|
||||||
SW_SHOWNORMAL ) ;
|
SW_SHOWNORMAL ) ;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue