]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a problem with node traversal masks and paged model loading that
authorfrohlich <frohlich>
Sun, 12 Apr 2009 09:53:05 +0000 (09:53 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 15 Apr 2009 21:19:30 +0000 (23:19 +0200)
shows up as a non solid carrier under some circumstance.

Modified Files:
AIBase.cxx AIBase.hxx AIShip.cxx

src/AIModel/AIBase.cxx

index 476ada122b117f9c55b2f7975dc81f2c33e258f3..a57b5505d636c4d50ca17048702c93ff56d99ae2 100644 (file)
@@ -174,7 +174,6 @@ bool FGAIBase::init(bool search_in_AI_path) {
     model = load3DModel(f, props);
 
     if (model.valid() && _initialized == false) {
-        model->setNodeMask(model->getNodeMask() & ~SG_NODEMASK_TERRAIN_BIT);
         aip.init( model.get() );
         aip.setVisible(true);
         invisible = false;
@@ -192,6 +191,9 @@ bool FGAIBase::init(bool search_in_AI_path) {
 void FGAIBase::initModel(osg::Node *node)
 {
     if (model.valid()) {
+        // Disable altitude computations for general AI models.
+        model->setNodeMask(model->getNodeMask() & ~SG_NODEMASK_TERRAIN_BIT);
+
         fgSetString("/ai/models/model-added", props->getPath());
 
     } else if (!model_path.empty()) {