1
0
Fork 0

Use enable-hot flag in model manager.

Allow control of the terrain flag on models added via the model
manager at runtime.

Designed and requested by Henning Stahlke
This commit is contained in:
James Turner 2017-01-25 22:19:15 +00:00
parent a0f2726a39
commit 0fe14f7c36

View file

@ -129,6 +129,17 @@ FGModelMgr::add_model (SGPropertyNode * node)
else
model->setHeadingDeg(node->getDoubleValue("heading-deg"));
if (node->hasChild("enable-hot")) {
osg::Node::NodeMask mask = model->getSceneGraph()->getNodeMask();
if (node->getBoolValue("enable-hot")) {
mask |= SG_NODEMASK_TERRAIN_BIT;
} else {
mask &= ~SG_NODEMASK_TERRAIN_BIT;
}
model->getSceneGraph()->setNodeMask(mask);
}
// Add this model to the global scene graph
globals->get_scenery()->get_scene_graph()->addChild(model->getSceneGraph());