本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}