public override void Execute( ISceneQueryListener listener )
{
List<PCZSceneNode> list = new List<PCZSceneNode>();
//find the nodes that intersect the AAB
( (PCZSceneManager)creator ).FindNodesIn( box, ref list, startZone, (PCZSceneNode)excludeNode );
//grab all moveables from the node that intersect...
foreach ( PCZSceneNode node in list )
{
foreach ( MovableObject m in node.Objects )
{
if ( ( m.QueryFlags & queryMask ) != 0 &&
( m.TypeFlags & queryTypeMask ) != 0 &&
m.IsAttached &&
box.Intersects( m.GetWorldBoundingBox() ) )
{
listener.OnQueryResult( m );
// deal with attached objects, since they are not directly attached to nodes
if ( m.MovableType == "Entity" )
{
//Check: not sure here...
Entity e = (Entity)m;
foreach ( MovableObject c in e.SubEntities )
{
if ( ( c.QueryFlags & queryMask ) > 0 )
{
listener.OnQueryResult( c );
}
}
}
}
}
}
// reset startzone and exclude node
startZone = null;
excludeNode = null;
}
}