diff --git a/ext/ghoul b/ext/ghoul index 849cc67bdc..901a96beda 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 849cc67bdc2550a43d8174490d39b14ee148b795 +Subproject commit 901a96bedad5fa789b4e45e61e97c5c1d909631c diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 0ae92c4713..e547159681 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -71,6 +71,7 @@ public: //void addNode(SceneGraphNode* child); + void addChild(SceneGraphNode* child); void setParent(SceneGraphNode* parent); //bool abandonChild(SceneGraphNode* child); diff --git a/src/scene/scenegraph.cpp b/src/scene/scenegraph.cpp index cf69955fb5..00975b8485 100644 --- a/src/scene/scenegraph.cpp +++ b/src/scene/scenegraph.cpp @@ -261,6 +261,8 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) { } node->node->setParent(parentNode); + parentNode->addChild(node->node); + } // Setup dependencies diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index c3f36f9e23..5f88de541d 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -155,10 +155,10 @@ bool SceneGraphNode::deinitialize() { delete _ephemeris; _ephemeris = nullptr; - for (SceneGraphNode* child : _children) { - child->deinitialize(); - delete child; - } + // for (SceneGraphNode* child : _children) { + // child->deinitialize(); + // delete child; + //} _children.clear(); // reset variables @@ -283,6 +283,11 @@ void SceneGraphNode::setParent(SceneGraphNode* parent) _parent = parent; } +void SceneGraphNode::addChild(SceneGraphNode* child) { + _children.push_back(child); +} + + //not used anymore @AA //bool SceneGraphNode::abandonChild(SceneGraphNode* child) { // std::vector < SceneGraphNode* >::iterator it = std::find(_children.begin(), _children.end(), child);