mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 12:10:52 -06:00
Added function to remove child in SceneGraphNode
This commit is contained in:
@@ -68,6 +68,8 @@ public:
|
||||
void addNode(SceneGraphNode* child);
|
||||
|
||||
void setParent(SceneGraphNode* parent);
|
||||
bool abandonChild(SceneGraphNode* child);
|
||||
|
||||
const psc& position() const;
|
||||
psc worldPosition() const;
|
||||
|
||||
|
||||
@@ -291,6 +291,17 @@ void SceneGraphNode::setParent(SceneGraphNode* parent)
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
bool SceneGraphNode::abandonChild(SceneGraphNode* child) {
|
||||
std::vector < SceneGraphNode* >::iterator it = std::find(_children.begin(), _children.end(), child);
|
||||
|
||||
if (it != _children.end()){
|
||||
_children.erase(it);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const psc& SceneGraphNode::position() const
|
||||
{
|
||||
return _ephemeris->position();
|
||||
|
||||
Reference in New Issue
Block a user