예제 #1
0
        private QuadTreeNode(TileRegion region)
        {
            this.region = region;

            TileCoord center = region.Center;
            TileCoord start = region.Start;
            TileCoord end = region.End;

            this.box = new ABox();
            this.box.Add(new OpenTK.Vector3(start.Col, start.Row, start.Alt));
            this.box.Add(new OpenTK.Vector3(end.Col, end.Row, end.Alt));

            if (region.TileCount > 16)
            {
                leaf = false;
                children[0] = new QuadTreeNode(new TileRegion(
                    start,
                    center));
                children[1] = new QuadTreeNode(new TileRegion(
                    new TileCoord(center.Row, start.Col, 0),
                    new TileCoord(end.Row, center.Col, 0)));
                children[2] = new QuadTreeNode(new TileRegion(
                    center,
                    end));
                children[3] = new QuadTreeNode(new TileRegion(
                    new TileCoord(start.Row, center.Col, 0),
                    new TileCoord(center.Row, end.Col, 0)));
            }
            else
            {
                leaf = true;
            }
        }
예제 #2
0
 public bool Intersects(ABox box)
 {
     return false;
 }