Esempio n. 1
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. 2
0
bool FaSoundEditor::unLoad()
{
    if(!mLoaded->get())
        return true;

    destroyBoundingBox();

    if(mHandle)
    {
        Ogre::Node *parent = mHandle->getParent();
        parent->removeChild(mHandle);
        mOgitorsRoot->GetSceneManager()->destroySceneNode(mHandle);
        mOgitorsRoot->GetSceneManager()->destroyEntity(mEntity);
        mHandle = 0;
        mEntity = 0;
    }
    
    mLoaded->set(false);
    return true;
}
Esempio n. 3
0
void VLogicModel::setVisible(VBOOL visible)
{
    if (mModelMainNode != VNULL)
    {
        mModelMainNode->setVisible(visible);

        Ogre::Node *parentNode = mModelMainNode->getParent();

        if (visible)
        {
            if (parentNode == VNULL)
            {
                mParentNode->addChild(mModelMainNode);
            }
            else
            {
                if (mParentNode != parentNode)
                {

                }
            }
        }
        else
        {
            if (parentNode != VNULL)
            {
                if (mParentNode != parentNode)
                {

                }

                parentNode->removeChild(mModelMainNode);
            }
            else
            {
                if (mVisible != visible)
                {

                }
            }
        }

        mVisible = visible;

        // 特效也需要设置可见性

        // locator上挂接的model也需要设置可见性
        for (VLocatorMap::iterator itr = mLocators.begin(); itr != mLocators.end(); ++itr)
        {
            VLocatorValue &locator = itr->second;

            for (VSlotMap::iterator i = locator.mSlots.begin(); i != locator.mSlots.end(); ++i)
            {
                VSlotValue &slot = i->second;
                if (slot.mModel != VNULL)
                {
                    slot.mModel->setVisible(visible);
                }
            }
        }

        // 设置技能特效可见性
        if (!visible)
        {

        }
    }
}