TL DR;
As SceneManageranyone can find, SceneNodeno matter where he is on the chart, when:
SceneManager::createSceneNode(...)Does the method explicitly state that the created nodes are not part of the graph? ¹ andSceneNodecan create their own children without knowledge SceneManager?
¹ SM does not automatically turn the nodes of the scene that it creates into child nodes of other nodes (for example, root); you need to manually call addChildon node for this
² The client can simply write sceneManager->getRootSceneNode()->createChildSceneNode("Child");, and SM will not know about the existence of a new child
Background
OGRE3D SceneManager ( → < < emphasis added):
virtual SceneNode* getSceneNode(const String& name) const;
, :
SceneNode* SceneManager::getSceneNode(const String& name) const
{
SceneNodeList::const_iterator i = mSceneNodes.find(name);
if (i == mSceneNodes.end())
{
OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "SceneNode '" + name + "' not found.",
"SceneManager::getSceneNode");
}
return i->second;
}
. , SM SceneNode SceneNodeList mSceneNodes. , , , , node, . SceneNode mSceneNodes SceneManager::createSceneNode(...). SM createSceneNode ( → < < ):
virtual SceneNode* createSceneNode(const String& name);
, SceneNode, createChild(const String& name, ...), SceneManager, :
SceneNode* SceneNode::createChildSceneNode(const Vector3& inTranslate,
const Quaternion& inRotate)
{
return static_cast<SceneNode*>(this->createChild(inTranslate, inRotate));
}
SceneNode* SceneNode::createChildSceneNode(const String& name, const Vector3& inTranslate,
const Quaternion& inRotate)
{
return static_cast<SceneNode*>(this->createChild(name, inTranslate, inRotate));
}
, node.createChildSceneNode(...);, SceneManager node, AFAIK, .
, . BspSceneManager BspSceneNode, , - , .
/ :
commit 3b13abbdcce146b2813a6cc3bedf16d1d6084340
Author: mkultra333 <unknown>
Date: Sun May 8 19:31:39 2016 +0800