public void FindNodes( AxisAlignedBox box, SceneNodeCollection sceneNodeList, SceneNode exclude, bool full, Octree octant )
{
List<OctreeNode> localList = new List<OctreeNode>();
if ( octant == null )
{
octant = this.octree;
}
if ( !full )
{
AxisAlignedBox obox = octant.CullBounds;
Intersection isect = this.Intersect( box, obox );
if ( isect == Intersection.Outside )
{
return;
}
full = ( isect == Intersection.Inside );
}
foreach ( OctreeNode node in octant.NodeList.Values )
{
if ( node != exclude )
{
if ( full )
{
localList.Add( node );
}
else
{
Intersection nsect = this.Intersect( box, node.WorldAABB );
if ( nsect != Intersection.Outside )
{
localList.Add( node );
}
}
}
}
if ( octant.Children[ 0, 0, 0 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 0, 0 ] );
if ( octant.Children[ 1, 0, 0 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 0, 0 ] );
if ( octant.Children[ 0, 1, 0 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 1, 0 ] );
if ( octant.Children[ 1, 1, 0 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 1, 0 ] );
if ( octant.Children[ 0, 0, 1 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 0, 1 ] );
if ( octant.Children[ 1, 0, 1 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 0, 1 ] );
if ( octant.Children[ 0, 1, 1 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 0, 1, 1 ] );
if ( octant.Children[ 1, 1, 1 ] != null )
FindNodes( box, sceneNodeList, exclude, full, octant.Children[ 1, 1, 1 ] );
}