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:
parent
a0f2726a39
commit
0fe14f7c36
1 changed files with 11 additions and 0 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in a new issue