本文整理汇总了C++中ogre::SceneManager::destroySceneNode方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneManager::destroySceneNode方法的具体用法?C++ SceneManager::destroySceneNode怎么用?C++ SceneManager::destroySceneNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneManager
的用法示例。
在下文中一共展示了SceneManager::destroySceneNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AboutToBeDestroyed
EC_Placeable::~EC_Placeable()
{
if (world_.expired())
{
if (sceneNode_)
LogError("EC_Placeable: World has expired, skipping uninitialization!");
return;
}
emit AboutToBeDestroyed();
OgreWorldPtr world = world_.lock();
Ogre::SceneManager* sceneMgr = world->GetSceneManager();
if (sceneNode_)
{
DetachNode();
sceneMgr->destroySceneNode(sceneNode_);
sceneNode_ = 0;
}
// Destroy the attachment node if it was created
if (boneAttachmentNode_)
{
sceneMgr->getRootSceneNode()->removeChild(boneAttachmentNode_);
sceneMgr->destroySceneNode(boneAttachmentNode_);
boneAttachmentNode_ = 0;
}
}
示例2: doDisable
void Obstacle::doDisable()
{
Ogre::SceneManager* sm = OgreGraphicsManager::getSingleton().getSceneManager();
_node->detachObject(_entity);
sm->destroySceneNode(_node);
sm->destroyEntity(_entity);
}
示例3: GetName
NxNode::~NxNode()
{
LogMsg("Erasing NxNode : " + GetName() );
LogMsg("Erasing NxActors ... " );
NxActorListIterator NxActorsIter = GetNxActorIterator();
while( NxActorsIter.hasMoreElements() ){
delete NxActorsIter.getNext();
}
mNxActors.clear();
LogMsg("Erasing NxActors : DONE" );
LogMsg("Erasing NxSounds ... " );
NxSoundMapIterator SoundIter = GetNxSoundIterator();
while( SoundIter.hasMoreElements() ){
delete SoundIter.getNext();
}
LogMsg("Erasing NxSounds : DONE" );
LogMsg("Erasing NxEntities... " );
NxEntityListIterator EntityIter = GetNxEntityIterator();
while( EntityIter.hasMoreElements() ){
delete EntityIter.getNext();
}
LogMsg("Erasing NxEntities : DONE" );
Ogre::SceneManager * mManager = mSceneNode->getCreator(); // detach child first ?
mManager->destroySceneNode( mSceneNode );
LogMsg("Erasing NxNode : Done" );
LogMsg("-----------------------");
}
示例4: Destroy
void EC_Terrain::Destroy()
{
assert(GetFramework());
if (!GetFramework())
return;
boost::shared_ptr<OgreRenderer::Renderer> renderer = GetFramework()->GetServiceManager()->GetService<OgreRenderer::Renderer>().lock();
if (!renderer) // Oops! Inconvenient dtor order - can't delete our own stuff since we can't get an instance to the owner.
return;
Ogre::SceneManager *sceneMgr = renderer->GetSceneManager();
if (!sceneMgr) // Oops! Same as above.
return;
for(int y = 0; y < cNumPatchesPerEdge; ++y)
for(int x = 0; x < cNumPatchesPerEdge; ++x)
{
Ogre::SceneNode *node = GetPatch(x, y).node;
if (!node)
continue;
sceneMgr->getRootSceneNode()->removeChild(node);
// sceneMgr->destroyManualObject(dynamic_cast<Ogre::ManualObject*>(node->getAttachedObject(0)));
node->detachAllObjects();
sceneMgr->destroySceneNode(node);
}
}
示例5:
AreaEffect::~AreaEffect()
{
delete Ghost;
delete GraphicsSettings;
delete PhysicsSettings;
Ogre::SceneManager* OgreManager = Entresol::GetSingletonPtr()->GetSceneManager()->GetGraphicsWorldPointer();
if(GraphicsObject)
OgreManager->destroyEntity(GraphicsObject);
OgreManager->destroySceneNode(GraphicsNode);
}
示例6: setValue
//!
//! Remove and destroy this scene.
//!
void Model2SceneNode::destroySceneNode()
{
if (m_sceneNode) {
// destroy the scene node through its scene manager
Ogre::SceneManager *sceneManager =OgreManager::getSceneManager();
if (sceneManager) {
sceneManager->destroySceneNode(m_sceneNode);
m_sceneNode = 0;
setValue(m_outputGeometryName, m_sceneNode, true);
}
}
}
示例7:
gkDebugger::~gkDebugger()
{
if (m_node && m_parent->isInstanced())
{
Ogre::SceneManager* mgr = m_parent->getManager();
mgr->destroySceneNode(m_node);
m_node = 0;
}
delete mRenderOp.vertexData;
mRenderOp.vertexData = 0;
m_buffer.setNull();
}
示例8: RemoveWaterPlane
EC_WaterPlane::~EC_WaterPlane()
{
if (world_.expired())
return;
OgreWorldPtr world = world_.lock();
RemoveWaterPlane();
if (node_ != 0)
{
Ogre::SceneManager* sceneMgr = world->GetSceneManager();
sceneMgr->destroySceneNode(node_);
node_ = 0;
}
}
示例9:
void
BoxCenterManager::init()
{
mBoxCenterObjMap.clear();
ObjBoxCenterMap::iterator iter;
for(iter = mObjBoxCenterMap.begin();iter != mObjBoxCenterMap.end();iter++)
{
Ogre::MovableObject* mv = iter->second;
if (mv->getParentSceneNode())
{
Ogre::SceneManager* pSceneManager = mv->getParentSceneNode()->getCreator();
pSceneManager->destroySceneNode(mv->getParentSceneNode());
}
delete iter->second;
}
mObjBoxCenterMap.clear();
}
示例10: LogError
EC_Mesh::~EC_Mesh()
{
if (world_.expired())
{
// Log error only if there was an Ogre object to be destroyed
if (entity_)
LogError("EC_Mesh: World has expired, skipping uninitialization!");
return;
}
OgreWorldPtr world = world_.lock();
RemoveMesh();
if (adjustment_node_)
{
Ogre::SceneManager* sceneMgr = world->OgreSceneManager();
sceneMgr->destroySceneNode(adjustment_node_);
adjustment_node_ = 0;
}
}
示例11: while
//!
//! Remove and destroy this scene children.
//! \param The scenenode to be destroyed
//!
void Model2SceneNode::destroyAllChildren( Ogre::SceneNode* i_pSceneNode )
{
if ( !i_pSceneNode || i_pSceneNode->numChildren() == 0 )
return;
// Destroy all the attached objects
Ogre::SceneNode::ObjectIterator itObject = i_pSceneNode->getAttachedObjectIterator();
// Recurse to child SceneNodes
Ogre::SceneNode::ChildNodeIterator itChild = i_pSceneNode->getChildIterator();
while ( itChild.hasMoreElements() )
{
Ogre::SceneNode* pChildNode = static_cast<Ogre::SceneNode*>(itChild.getNext());
destroyAllAttachedMovableObjects( pChildNode );
// obtain the OGRE scene manager
Ogre::SceneManager *sceneManager = OgreManager::getSceneManager();
if (pChildNode != m_sceneNode)
sceneManager->destroySceneNode( pChildNode->getName() );
}
}
示例12:
Camera::~Camera()
{
Ogre::Root& root = Ogre::Root::getSingleton();
Ogre::SceneManager* sceneMgr = root.getSceneManager(BFG_SCENEMANAGER);
mSubLane.reset();
if (mRenderTargetCreated)
{
Ogre::TextureManager::getSingleton().remove(stringify(mHandle));
Ogre::MaterialManager::getSingleton().remove(stringify(mHandle));
mRenderTarget = NULL;
}
sceneMgr->destroyCamera(stringify(mHandle));
if (mNodeCreated)
{
sceneMgr->destroySceneNode(mCameraNode);
}
}
示例13: RemoveAttachmentMesh
void EC_Mesh::RemoveAttachmentMesh(uint index)
{
OgreWorldPtr world = world_.lock();
if (!entity_)
return;
if (index >= attachment_entities_.size())
return;
Ogre::SceneManager* sceneMgr = world->OgreSceneManager();
if (attachment_entities_[index] && attachment_nodes_[index])
{
// See if attached to a tagpoint or an ordinary node
Ogre::TagPoint* tag = dynamic_cast<Ogre::TagPoint*>(attachment_nodes_[index]);
if (tag)
{
entity_->detachObjectFromBone(attachment_entities_[index]);
}
else
{
Ogre::SceneNode* scenenode = dynamic_cast<Ogre::SceneNode*>(attachment_nodes_[index]);
if (scenenode)
{
scenenode->detachObject(attachment_entities_[index]);
sceneMgr->destroySceneNode(scenenode);
}
}
attachment_nodes_[index] = 0;
}
if (attachment_entities_[index])
{
if (attachment_entities_[index]->sharesSkeletonInstance())
attachment_entities_[index]->stopSharingSkeletonInstance();
sceneMgr->destroyEntity(attachment_entities_[index]);
attachment_entities_[index] = 0;
}
}
示例14: operator
bool operator()()
{
if(!component->ready())
return false;
Ogre::SceneManager* sm = GraphicsManager::get().sceneManager();
sm->destroySceneNode(
Ogre::StringConverter::toString(component->localId()));
sm->destroyEntity(
Ogre::StringConverter::toString(component->localId()));
component->m_sceneNode = 0;
component->m_particleSystem = 0;
ThreadPool::get().schedule(boost::bind(
&ComponentContainer::componentDetachedCallback,
component->parent(), component));
return true;
}
示例15:
Camera::~Camera()
{
Ogre::Root& root = Ogre::Root::getSingleton();
Ogre::SceneManager* sceneMgr = root.getSceneManager(BFG_SCENEMANAGER);
Main::eventLoop()->disconnect(ID::VE_UPDATE_POSITION, this);
Main::eventLoop()->disconnect(ID::VE_UPDATE_ORIENTATION, this);
if (mRenderTargetCreated)
{
Ogre::TextureManager::getSingleton().remove(stringify(mHandle));
Ogre::MaterialManager::getSingleton().remove(stringify(mHandle));
mRenderTarget = NULL;
}
sceneMgr->destroyCamera(stringify(mHandle));
if (mNodeCreated)
{
sceneMgr->destroySceneNode(mCameraNode);
}
}