OctreeNode.GetNode C# (CSharp) Method

GetNode() public method

public GetNode ( OctreeBox, rect, ArrayList nodes ) : ArrayList
rect OctreeBox,
nodes ArrayList
return ArrayList
    public ArrayList GetNode(OctreeBox rect, ArrayList nodes)
    {
        if (Branch == null)
        {
            var things = Items.GetEnumerator();
            while (things.MoveNext())
            {
                var qtl = (OctreeLeaf)things.Current;
                if (qtl != null && rect.PointWithinBounds(qtl.X, qtl.Y, qtl.Z))
                    nodes.Add(qtl.LeafObject);
            }
        }
        else
        {
            foreach (var t in Branch.Where(t => t.Bounds.Within(rect)))
            {
                t.GetNode(rect, nodes);
            }
        }
        return nodes;
    }

Same methods

OctreeNode::GetNode ( float xMax, float xMin, float yMax, float yMin, float zMax, float zMin ) : ArrayList
OctreeNode::GetNode ( float xMax, float xMin, float yMax, float yMin, float zMax, float zMin, ArrayList nodes ) : ArrayList
OctreeNode::GetNode ( Vector3 vector ) : object
OctreeNode::GetNode ( Vector3 vector, double shortestDistance ) : object
OctreeNode::GetNode ( float x, float y, float z ) : object
OctreeNode::GetNode ( float x, float y, float z, double shortestDistance ) : object

Usage Example

Beispiel #1
0
 public object GetNode(float x, float y, float z)
 {
     return(Top.GetNode(x, y, z));
 }