本文整理汇总了C++中ogre::SceneNode::removeChild方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneNode::removeChild方法的具体用法?C++ SceneNode::removeChild怎么用?C++ SceneNode::removeChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneNode
的用法示例。
在下文中一共展示了SceneNode::removeChild方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DetachEntity
void EC_WaterPlane::DetachEntity()
{
if (!attached_ || entity_ == 0)
return;
EC_Placeable* placeable = dynamic_cast<EC_Placeable*>(FindPlaceable().get());
if (placeable != 0 && !attachedToRoot_)
{
Ogre::SceneNode* node = placeable->GetSceneNode();
node_->detachObject(entity_);
node->removeChild(node_);
}
else
{
// Attached to root.
// Sanity check..
if (entity_->isAttached() )
{
Ogre::SceneManager* sceneMgr = world_.lock()->GetSceneManager();
node_->detachObject(entity_);
sceneMgr->getRootSceneNode()->removeChild(node_);
attachedToRoot_ = false;
}
}
attached_ = false;
}
示例2: removeFromScene
void Entity::removeFromScene() {
Ogre::SceneNode *oldParent = mSceneNode->getParentSceneNode();
if (oldParent) {
oldParent->removeChild(mSceneNode);
}
setStatic(true);
}
示例3: SetVisible
VOID CFairyObject::SetVisible(BOOL bVisible)
{
if(m_bVisible == bVisible) return;
//确认是人物模型
if(m_pFairyObj->getType() != EOBJ_TYPE_ACTOR) return;
//确认资源已经Load
Fairy::Actor* pActor = ((Fairy::ActorObject*)m_pFairyObj.get())->getActor();
if(!pActor) return;
Ogre::SceneNode* pParentNode = ((Fairy::ActorObject*)m_pFairyObj.get())->getSceneNode();
Ogre::SceneNode* pActorNode = (((Fairy::ActorObject*)m_pFairyObj.get())->getActor())->getSceneNode();
if(bVisible)
{
pParentNode->addChild(pActorNode);
}
else
{
pParentNode->removeChild(pActorNode);
}
m_bVisible = bVisible;
}
示例4: DetachNode
void EC_OgreMovableTextOverlay::DetachNode()
{
if ((node_) && (attached_) && (placeable_))
{
Ogre::SceneNode* parent = checked_static_cast<EC_OgrePlaceable*>(placeable_.get())->GetLinkSceneNode();
parent->removeChild(node_);
attached_ = false;
}
}
示例5: DetachEntity
void EC_Mesh::DetachEntity()
{
if ((!attached_) || (!entity_) || (!placeable_))
return;
EC_Placeable* placeable = checked_static_cast<EC_Placeable*>(placeable_.get());
Ogre::SceneNode* node = placeable->GetSceneNode();
adjustment_node_->detachObject(entity_);
node->removeChild(adjustment_node_);
attached_ = false;
}
示例6:
void
RenderingManager::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur)
{
Ogre::SceneNode *child =
mRendering.getScene()->getSceneNode(old.getRefData().getHandle());
Ogre::SceneNode *parent = child->getParentSceneNode();
parent->removeChild(child);
if (old.getClass().isActor()) {
mActors->updateObjectCell(old, cur);
} else {
mObjects->updateObjectCell(old, cur);
}
}
示例7:
void OGRE3DPointRenderable::removeSceneNode(const Ogre::String& name)
{
if (mRenderSystem->getSceneManager()->hasSceneNode(name) == false)
return;
Ogre::SceneNode* node = mRenderSystem->getSceneManager()->getSceneNode(name);
Ogre::SceneNode* pnode = node->getParentSceneNode();
if (pnode == 0)
return;
if (pnode == mNode)
pnode->removeChild(node);
}
示例8: onSetTarget
void Camera::onSetTarget(const GameHandle& target)
{
//! \hack const offset for camera
v3 offset(0.0f, 3.0f, -14);
Ogre::SceneManager* sceneMgr = Ogre::Root::getSingleton().getSceneManager(BFG_SCENEMANAGER);
if (!sceneMgr->hasSceneNode(stringify(target)))
{
errlog << "Target (" << stringify(target) << ") for camera (" << mHandle << ") does not exist!";
return;
}
Ogre::SceneNode* newParent = sceneMgr->getSceneNode(stringify(target));
Ogre::SceneNode* oldParent = mCameraNode->getParentSceneNode();
oldParent->removeChild(mCameraNode);
newParent->addChild(mCameraNode);
mCameraNode->setPosition(toOgre(offset));
}
示例9: DetachFromParent
void NxNode::DetachFromParent()
{
Ogre::SceneNode * parent = mSceneNode->getParentSceneNode();
if(parent) parent->removeChild( mSceneNode->getName() );
}