mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 03:00:58 -06:00
Correctly set child nodes for SceneGraphNode%s
This commit is contained in:
Submodule ext/ghoul updated: 849cc67bdc...901a96beda
@@ -71,6 +71,7 @@ public:
|
||||
|
||||
//void addNode(SceneGraphNode* child);
|
||||
|
||||
void addChild(SceneGraphNode* child);
|
||||
void setParent(SceneGraphNode* parent);
|
||||
//bool abandonChild(SceneGraphNode* child);
|
||||
|
||||
|
||||
@@ -261,6 +261,8 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) {
|
||||
}
|
||||
|
||||
node->node->setParent(parentNode);
|
||||
parentNode->addChild(node->node);
|
||||
|
||||
}
|
||||
|
||||
// Setup dependencies
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user