本文整理汇总了C++中ogre::Node::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getName方法的具体用法?C++ Node::getName怎么用?C++ Node::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Node
的用法示例。
在下文中一共展示了Node::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _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();
}
示例2: Init
void EditorFrameHandler::Init()
{
Ogre::SceneManager *scene_manager = CommonDeclarations::GetSceneManager();
EditorCamera = scene_manager->createCamera("EditorCamera");
EditorCamera->setNearClipDistance(5);
EditorCamera->setFarClipDistance(0);
EditorCamera->setPosition(CommonDeclarations::GetCamera()->GetOgreCamera()->getWorldPosition());
CommonDeclarations::GetApplication()->SetCurrentCamera(EditorCamera);
/*CommonDeclarations::ObjectsPool *objects = CommonDeclarations::GetEditableObjects();
for (CommonDeclarations::ObjectsPool::ListNode *pos = objects->GetBegin();pos!=NULL;pos=pos->Next)
{
SEditableObject obj;
obj.Object = pos->Value;
IScenable *scen = pos->Value->GetScenable();
if (scen)
{
obj.EditNode = NULL;
obj.EditEntity = NULL;
ICollidable *collid = pos->Value->GetCollidable();
if (collid)
{
obj.CollisionModel = collid->GetCollisionModel();
} else
{
const char *modelname = scen->GetModelName();
if (NULL == modelname)
modelname = AAUtilities::StringCopy("cube.mesh");
obj.CollisionModel = GetCollisionModel(modelname);
}
} else
{
obj.EditNode = scene_manager->getRootSceneNode()->createChildSceneNode();
char *buffer = CommonDeclarations::GenGUID();
obj.EditEntity = scene_manager->createEntity(buffer, "cube.mesh");
delete [] buffer;
obj.EditNode->attachObject(obj.EditEntity);
obj.CollisionModel = GetCollisionModel("cube.mesh");
}
EditableObjects.PushBack(obj);
}
delete objects;*/
//
CommonDeclarations::ObjectsPool *objects = CommonDeclarations::GetEditableObjects();
const char *str;
TiXmlElement *node = 0, *nodes, *env;
env = SceneRootElement->FirstChildElement("environment");
if (env)
{
node = env->FirstChildElement("skyBox");
if (node)
{
SEditableDescription descr;
descr.EditNode = NULL;
descr.EditElement = node;
EditorNodes.insert(std::make_pair("SkyBox", descr));
}
}
nodes = SceneRootElement->FirstChildElement("nodes");
if (nodes)
{
node = nodes->FirstChildElement("node");
Ogre::Node::ChildNodeIterator iFirst = scene_manager->getRootSceneNode()->getChildIterator(), iPos = iFirst;
while (node)
{
str = node->Attribute("name");
SEditableDescription descr;
Ogre::Node *t = NULL;
iPos = iFirst;
while (iPos.hasMoreElements())
{
t = iPos.getNext();
if (t->getName()==str)
{
descr.EditNode = t;
break;
}
}
descr.EditElement = node;
EditorNodes.insert(std::make_pair(str, descr));
node = node->NextSiblingElement("node");
}
}
delete objects;
//
MyGUI::Gui *gui = GUISystem::GetInstance()->GetGui();
OIS::Mouse *mouse = EditorFrameListener::GetInstance()->GetMouse();
//.........这里部分代码省略.........