internal void DestroySceneNode( SceneNode node, bool removeFromParent )
{
// Find any scene nodes which are tracking this node, and turn them off.
foreach ( SceneNode autoNode in this.autoTrackingSceneNodes.Values )
{
// Tracking this node
if ( autoNode.AutoTrackTarget == node )
{
// turn off, this will notify SceneManager to remove
autoNode.SetAutoTracking( false );
}
else if ( autoNode == node )
{
// node being removed is a tracker
autoTrackingSceneNodes.Remove( name );
}
}
if ( removeFromParent && node.Parent != null )
{
node.Parent.RemoveChild( node );
}
// removes the node from the list
sceneNodeList.Remove( node.Name );
}