public override void Execute( ISceneQueryListener listener )
{
MovableObjectFactoryMap factories = Root.Instance.MovableObjectFactories;
foreach ( KeyValuePair<string, MovableObjectFactory> map in factories )
{
MovableObjectCollection movableObjects = this.creator.GetMovableObjectCollection( map.Value.Type );
foreach ( MovableObject movableObject in movableObjects.Values )
{
// skip group if query type doesn't match
if ( ( this.QueryTypeMask & movableObject.TypeFlags ) == 0 )
{
break;
}
// skip if unattached or filtered out by query flags
if ( !movableObject.IsAttached || ( movableObject.QueryFlags & this.queryMask ) == 0 )
{
continue;
}
for ( int v = 0; v < this.volumes.Count; v++ )
{
PlaneBoundedVolume volume = (PlaneBoundedVolume)this.volumes[ v ];
// Do AABB / plane volume test
if ( ( movableObject.QueryFlags & this.queryMask ) != 0
&& volume.Intersects( movableObject.GetWorldBoundingBox() ) )
{
listener.OnQueryResult( movableObject );
break;
}
}
}
}
}
}