当前位置: 首页>>代码示例>>C++>>正文


C++ PCZSceneNode::setHomeZone方法代码示例

本文整理汇总了C++中PCZSceneNode::setHomeZone方法的典型用法代码示例。如果您正苦于以下问题:C++ PCZSceneNode::setHomeZone方法的具体用法?C++ PCZSceneNode::setHomeZone怎么用?C++ PCZSceneNode::setHomeZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PCZSceneNode的用法示例。


在下文中一共展示了PCZSceneNode::setHomeZone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createChildSceneNode

 //-----------------------------------------------------------------------
 SceneNode* PCZSceneNode::createChildSceneNode(const String& name, const Vector3& inTranslate, 
     const Quaternion& inRotate)
 {
     PCZSceneNode * childSceneNode = (PCZSceneNode*)(this->createChild(name, inTranslate, inRotate));
     if (mHomeZone)
     {
         childSceneNode->setHomeZone(mHomeZone);
         mHomeZone->_addNode(childSceneNode);
     }
     return static_cast<SceneNode*>(childSceneNode);
 }
开发者ID:bsmr-c-cpp,项目名称:ogre,代码行数:12,代码来源:OgrePCZSceneNode.cpp

示例2: destroyZone

	/* if destroySceneNodes is true, then all nodes which have the destroyed
	   zone as their homezone are desroyed too.  If destroySceneNodes is false
	   then all scene nodes which have the zone as their homezone will have
	   their homezone pointer set to 0, which will allow them to be re-assigned
	   either by the user or via the automatic re-assignment routine */
	void PCZSceneManager::destroyZone(PCZone* zone, bool destroySceneNodes)
	{
		// need to remove this zone from all lights affected zones list,
		// otherwise next frame _calcZonesAffectedByLights will call PCZLight::getNeedsUpdate()
		// which will try to access the zone pointer and will cause an access violation
		MovableObjectCollection* lights =
		getMovableObjectCollection(PCZLightFactory::FACTORY_TYPE_NAME);
		{
			OGRE_LOCK_MUTEX(lights->mutex) // Is locking necessary in destroyZone? I don't know..

			MovableObjectIterator it(lights->map.begin(), lights->map.end());

			while(it.hasMoreElements())
			{
				PCZLight* l = static_cast<PCZLight*>(it.getNext());
				if(l) 
				{
					// no need to check, this function does that anyway. if exists, is erased.
					l->removeZoneFromAffectedZonesList(zone);   
				}
			}
		}
		// if not destroying scene nodes, then make sure any nodes who have
		// this zone as homezone are set to have 0 for a homezone
		for (SceneNodeList::iterator i = mSceneNodes.begin();
			i != mSceneNodes.end(); ++i)
		{
			PCZSceneNode * pczsn = (PCZSceneNode*)(i->second);
			if (!destroySceneNodes)
			{
				if (pczsn->getHomeZone() == zone)
				{
					pczsn->setHomeZone(0);
				}
			}
			// reset all node visitor lists
			// note, it might be more efficient to only do this to nodes which
			// are actually visiting the zone being destroyed, but visitor lists
			// get cleared every frame anyway, so it's not THAT big a deal.
			pczsn->clearNodeFromVisitedZones();
		}

		ZoneMap::iterator it;
		it = mZones.find(zone->getName());
		if (it != mZones.end())
		{
			mZones.erase(zone->getName());
		}
		OGRE_DELETE zone;
	}
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:55,代码来源:OgrePCZSceneManager.cpp

示例3: removeSceneNode

    /** Removes all references to the node from every zone in the scene.  
    */
    void PCZSceneManager::removeSceneNode( SceneNode * sn )
    {
	    // Skip if mDefaultZone has been destroyed (shutdown conditions)
	    if (!mDefaultZone)
		    return;

		PCZSceneNode * pczsn = (PCZSceneNode*)sn;

		// clear all references to the node in visited zones
		pczsn->clearNodeFromVisitedZones();

        // tell the node it's not in a zone
        pczsn->setHomeZone(0);
    }
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:16,代码来源:OgrePCZSceneManager.cpp

示例4: setNodeHomeZone

	// set the home zone for a scene node
	void PCZSceneManager::setNodeHomeZone(SceneNode *node, PCZone *zone)
	{
		// cast the Ogre::SceneNode to a PCZSceneNode
		PCZSceneNode * pczsn = (PCZSceneNode*)node;
		pczsn->setHomeZone(zone);
	}
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:7,代码来源:OgrePCZSceneManager.cpp


注:本文中的PCZSceneNode::setHomeZone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。