Esempio n. 1
0
void GraphicsImpl::removeNode(int ID)
{
	Ogre::SceneNode* node = nodes[ID];

	if (node->getParent() != NULL) {
		node->getParent()->removeChild(node);
	}

	node->removeAndDestroyAllChildren();

	delete node;
	nodes.erase(ID);
}
Esempio n. 2
0
Ogre::SceneNode * WheelAnimalSceneObj::getBaseCenter()
{
	if(_sn == NULL)
	{
		_sn =  Orz::OgreGraphicsManager::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(getCenterPoint());
		//_sn->yaw(Ogre::Radian(Ogre::Math::PI));
		for(int i=0 ; i<(BASE_ALL-BASE_0); ++i)
		{
			Ogre::SceneNode * base = getBase(i);
			Ogre::Node * parent = base->getParent();
			Ogre::Vector3 p = base->getPosition();
			if(parent)
			{
				parent->removeChild(base);
			}
			base->translate(-getCenterPoint());
			_sn->addChild(base);
			Ogre::SceneManager * sm = OgreGraphicsManager::getSingleton().getSceneManager();
			Ogre::Entity * ent = sm->createEntity("ring"+Ogre::StringConverter::toString(i), "zp_dwdzgh.mesh");
			Ogre::SceneNode * node = base->createChildSceneNode("ring"+Ogre::StringConverter::toString(i),Ogre::Vector3(0.f, 10.f, 0.f));
			node->setScale(0.6f,0.6f,0.6f);
			node->attachObject(ent);
			Orz::OgreGraphicsManager::getSingleton().getSceneManager()->getSceneNode("ring"+Ogre::StringConverter::toString(i))->setVisible(false);
		}
	}
	return _sn;
}
Esempio n. 3
0
void Actor::attachActor(Actor* obj)
{
	Ogre::SceneNode* target = obj->getNode();
	gameLog("Actor::attachActor " + target->getName() + " to " + mNode->getName());
	target->getParent()->removeChild(target);
	mNode->addChild(target);
}