Esempio n. 1
0
    public static OctreeChildCoords FromIndex(OctreeNode.ChildIndex index)
    {
        switch (index)
        {
        case OctreeNode.ChildIndex.LeftBelowBack:
            return(new OctreeChildCoords(0, 0, 0));

        case OctreeNode.ChildIndex.LeftBelowForward:
            return(new OctreeChildCoords(0, 0, 1));

        case OctreeNode.ChildIndex.LeftAboveBack:
            return(new OctreeChildCoords(0, 1, 0));

        case OctreeNode.ChildIndex.LeftAboveForward:
            return(new OctreeChildCoords(0, 1, 1));

        case OctreeNode.ChildIndex.RightBelowBack:
            return(new OctreeChildCoords(1, 0, 0));

        case OctreeNode.ChildIndex.RightBelowForward:
            return(new OctreeChildCoords(1, 0, 1));

        case OctreeNode.ChildIndex.RightAboveBack:
            return(new OctreeChildCoords(1, 1, 0));

        case OctreeNode.ChildIndex.RightAboveForward:
            return(new OctreeChildCoords(1, 1, 1));

        default:
            throw new ArgumentOutOfRangeException("index", index, null);
        }
    }
Esempio n. 2
0
 public override Node ConstructNode(Bounds bounds, Node parent, OctreeNode.ChildIndex indexInParent)
 {
     return(new Node(bounds, parent, indexInParent, this));
 }
Esempio n. 3
0
 public abstract TNode ConstructNode(Bounds bounds, TNode parent, OctreeNode.ChildIndex indexInParent);
Esempio n. 4
0
 public override TestOctreeNode <T> ConstructNode(Bounds bounds, TestOctreeNode <T> parent,
                                                  OctreeNode.ChildIndex indexInParent)
 {
     return(new TestOctreeNode <T>(bounds, parent, indexInParent, this));
 }