本文整理汇总了C++中ogre::SceneNode::numChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneNode::numChildren方法的具体用法?C++ SceneNode::numChildren怎么用?C++ SceneNode::numChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneNode
的用法示例。
在下文中一共展示了SceneNode::numChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeCell
void Objects::removeCell(MWWorld::Ptr::CellStore* store)
{
if(mCellSceneNodes.find(store) != mCellSceneNodes.end())
{
Ogre::SceneNode* base = mCellSceneNodes[store];
for (int i=0; i<base->numChildren(); ++i)
clearSceneNode (static_cast<Ogre::SceneNode *> (base->getChild (i)));
base->removeAndDestroyAllChildren();
mCellSceneNodes.erase(store);
mRenderer.getScene()->destroySceneNode(base);
base = 0;
}
if(mStaticGeometry.find(store) != mStaticGeometry.end())
{
Ogre::StaticGeometry* sg = mStaticGeometry[store];
mStaticGeometry.erase(store);
mRenderer.getScene()->destroyStaticGeometry (sg);
sg = 0;
}
if(mStaticGeometrySmall.find(store) != mStaticGeometrySmall.end())
{
Ogre::StaticGeometry* sg = mStaticGeometrySmall[store];
mStaticGeometrySmall.erase(store);
mRenderer.getScene()->destroyStaticGeometry (sg);
sg = 0;
}
if(mBounds.find(store) != mBounds.end())
mBounds.erase(store);
}
示例2: _destroyAll
//-----------------------------------------------------------------------
void EntityRenderer::_destroyAll(void)
{
if (!mParentTechnique)
return;
// Delete the visual data
vector<EntityRendererVisualData*>::const_iterator it;
vector<EntityRendererVisualData*>::const_iterator itEnd = mAllVisualData.end();
for (it = mAllVisualData.begin(); it != itEnd; ++it)
{
PU_DELETE_T(*it, EntityRendererVisualData, MEMCATEGORY_SCENE_OBJECTS);
}
mAllVisualData.clear();
mVisualData.clear();
// V1.5: Destroy the created ChildSceneNodes (which leads to detaching the Entities)
if (mParentTechnique->getParentSystem())
{
Ogre::SceneNode* parentNode = mParentTechnique->getParentSystem()->getParentSceneNode();
if (parentNode)
{
String sceneNodeName;
std::stringstream ss;
unsigned short numChilds = parentNode->numChildren();
for (unsigned short i = 0; i < numChilds; ++i)
{
Ogre::Node* node = parentNode->getChild(i);
if (node)
{
Ogre::String name = node->getName();
if (name.find("ParticleUniverse") != Ogre::String::npos)
{
parentNode->removeAndDestroyChild(i);
}
}
}
}
} // V1.5
// Destroy the Entities. Do it like this, because it must be assured that the entity still exists
// and has not already been destroyed.
Ogre::SceneManager* sceneManager = mParentTechnique->getParentSystem()->getSceneManager();
for (size_t i = 0; i < mQuota; i++)
{
if (sceneManager->hasEntity(mEntityName + StringConverter::toString(i)))
{
sceneManager->destroyEntity(mEntityName + StringConverter::toString(i));
}
}
mEntities.clear();
// Reset the visual data in the pool
mParentTechnique->initVisualDataInPool();
}