本文整理汇总了C++中MovableObject::isInScene方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::isInScene方法的具体用法?C++ MovableObject::isInScene怎么用?C++ MovableObject::isInScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovableObject
的用法示例。
在下文中一共展示了MovableObject::isInScene方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//---------------------------------------------------------------------
void DefaultPlaneBoundedVolumeListSceneQuery::execute(SceneQueryListener* listener)
{
// Iterate over all movable types
Root::MovableObjectFactoryIterator factIt =
Root::getSingleton().getMovableObjectFactoryIterator();
while(factIt.hasMoreElements())
{
SceneManager::MovableObjectIterator objItA =
mParentSceneMgr->getMovableObjectIterator(
factIt.getNext()->getType());
while (objItA.hasMoreElements())
{
MovableObject* a = objItA.getNext();
// skip whole group if type doesn't match
if (!(a->getTypeFlags() & mQueryTypeMask))
break;
PlaneBoundedVolumeList::iterator pi, piend;
piend = mVolumes.end();
for (pi = mVolumes.begin(); pi != piend; ++pi)
{
PlaneBoundedVolume& vol = *pi;
// Do AABB / plane volume test
if ((a->getQueryFlags() & mQueryMask) &&
a->isInScene() &&
vol.intersects(a->getWorldBoundingBox()))
{
if (!listener->queryResult(a)) return;
break;
}
}
}
}
}
示例2: execute
//---------------------------------------------------------------------
void PagingLandScapeOctreePlaneBoundedVolumeListSceneQuery::execute(SceneQueryListener* listener)
{
PlaneBoundedVolumeList::iterator pi, piend;
piend = mVolumes.end();
for (pi = mVolumes.begin(); pi != piend; ++pi)
{
std::list < SceneNode* > list;
//find the nodes that intersect the AAB
static_cast< PagingLandScapeOctreeSceneManager* >(mParentSceneMgr)->findNodesIn(*pi, list, 0);
//grab all moveables from the node that intersect...
std::list < SceneNode* >::iterator it = list.begin();
while (it != list.end())
{
SceneNode::ObjectIterator oit = (*it)->getAttachedObjectIterator();
while (oit.hasMoreElements())
{
MovableObject* m = oit.getNext();
if ((m->getQueryFlags() & mQueryMask) && m->isInScene() && (*pi).intersects(m->getWorldBoundingBox()))
{
listener->queryResult(m);
}
}
++it;
}
}
}
开发者ID:holocronweaver,项目名称:python-ogre,代码行数:28,代码来源:OgrePagingLandScapeOctreePlaneBoundedVolumeListSceneQuery.cpp
示例3: execute
//---------------------------------------------------------------------
void PagingLandScapeOctreeRaySceneQuery::execute( RaySceneQueryListener* listener )
{
std::list < SceneNode* > list;
//find the nodes that intersect the AAB
static_cast< PagingLandScapeOctreeSceneManager* >( mParentSceneMgr )->findNodesIn( mRay, list, 0 );
//grab all movables from the node that intersect...
std::list < SceneNode* >::iterator it = list.begin( );
while ( it != list.end( ) )
{
SceneNode::ObjectIterator oit = ( *it )->getAttachedObjectIterator( );
while ( oit.hasMoreElements( ) )
{
MovableObject* m = oit.getNext( );
if ( ( m->getQueryFlags( ) & mQueryMask ) && m->isInScene( ) )
{
std::pair< bool, Real > result = mRay.intersects( m->getWorldBoundingBox( ) );
if ( result.first )
{
listener->queryResult( m, result.second );
}
}
}
++it;
}
}
示例4: execute
//---------------------------------------------------------------------
void PCZPlaneBoundedVolumeListSceneQuery::execute(SceneQueryListener* listener)
{
std::set<SceneNode*> checkedSceneNodes;
PlaneBoundedVolumeList::iterator pi, piend;
piend = mVolumes.end();
for (pi = mVolumes.begin(); pi != piend; ++pi)
{
PCZSceneNodeList list;
//find the nodes that intersect the Plane bounded Volume
static_cast<PCZSceneManager*>( mParentSceneMgr ) -> findNodesIn( *pi, list, mStartZone, (PCZSceneNode*)mExcludeNode );
//grab all moveables from the node that intersect...
PCZSceneNodeList::iterator it, itend;
itend = list.end();
for (it = list.begin(); it != itend; ++it)
{
// avoid double-check same scene node
if (!checkedSceneNodes.insert(*it).second)
continue;
SceneNode::ObjectIterator oit = (*it) -> getAttachedObjectIterator();
while( oit.hasMoreElements() )
{
MovableObject * m = oit.getNext();
if( (m->getQueryFlags() & mQueryMask) &&
(m->getTypeFlags() & mQueryTypeMask) &&
m->isInScene() &&
(*pi).intersects( m->getWorldBoundingBox() ) )
{
listener -> queryResult( m );
// deal with attached objects, since they are not directly attached to nodes
if (m->getMovableType() == "Entity")
{
Entity* e = static_cast<Entity*>(m);
Entity::ChildObjectListIterator childIt = e->getAttachedObjectIterator();
while(childIt.hasMoreElements())
{
MovableObject* c = childIt.getNext();
if (c->getQueryFlags() & mQueryMask &&
(*pi).intersects( c->getWorldBoundingBox()))
{
listener->queryResult(c);
}
}
}
}
}
}
}//for
// reset startzone and exclude node
mStartZone = 0;
mExcludeNode = 0;
}
示例5: execute
/** Finds any entities that intersect the AAB for the query. */
void OctreeAxisAlignedBoxSceneQuery::execute(SceneQueryListener* listener)
{
std::list< SceneNode * > _list;
//find the nodes that intersect the AAB
static_cast<OctreeSceneManager*>( mParentSceneMgr ) -> findNodesIn( mAABB, _list, 0 );
//grab all moveables from the node that intersect...
std::list< SceneNode * >::iterator it = _list.begin();
while( it != _list.end() )
{
SceneNode::ObjectIterator oit = (*it) -> getAttachedObjectIterator();
while( oit.hasMoreElements() )
{
MovableObject * m = oit.getNext();
if( (m->getQueryFlags() & mQueryMask) &&
(m->getTypeFlags() & mQueryTypeMask) &&
m->isInScene() &&
mAABB.intersects( m->getWorldBoundingBox() ) )
{
listener -> queryResult( m );
// deal with attached objects, since they are not directly attached to nodes
if (m->getMovableType() == "Entity")
{
Entity* e = static_cast<Entity*>(m);
Entity::ChildObjectListIterator childIt = e->getAttachedObjectIterator();
while(childIt.hasMoreElements())
{
MovableObject* c = childIt.getNext();
if (c->getQueryFlags() & mQueryMask)
{
listener->queryResult(c);
}
}
}
}
}
++it;
}
}