Ejemplo n.º 1
0
        private void CreateChildNodes()
        {
            hasChild = true;
            float sizeOver2 = size / 2.0f;
            float sizeOver4 = size / 4.0f;

            nodeUFR = new MyOcTreeNode(center + new Vector3(sizeOver4, sizeOver4, -sizeOver4), sizeOver2, myOcTree);
            nodeUFL = new MyOcTreeNode(center + new Vector3(-sizeOver4, sizeOver4, -sizeOver4), sizeOver2, myOcTree);
            nodeUBR = new MyOcTreeNode(center + new Vector3(sizeOver4, sizeOver4, sizeOver4), sizeOver2, myOcTree);
            nodeUBL = new MyOcTreeNode(center + new Vector3(-sizeOver4, sizeOver4, sizeOver4), sizeOver2, myOcTree);
            nodeDFR = new MyOcTreeNode(center + new Vector3(sizeOver4, -sizeOver4, -sizeOver4), sizeOver2, myOcTree);
            nodeDFL = new MyOcTreeNode(center + new Vector3(-sizeOver4, -sizeOver4, -sizeOver4), sizeOver2, myOcTree);
            nodeDBR = new MyOcTreeNode(center + new Vector3(sizeOver4, -sizeOver4, sizeOver4), sizeOver2, myOcTree);
            nodeDBL = new MyOcTreeNode(center + new Vector3(-sizeOver4, -sizeOver4, sizeOver4), sizeOver2, myOcTree);
        }
Ejemplo n.º 2
0
        private void CreateChildNodes()
        {
            float sizeOver2 = size / 2.0f;
            float sizeOver4 = size / 4.0f;

            nodeUFR = new MyOcTreeNode(center + new Vector3(sizeOver4, sizeOver4, -sizeOver4), sizeOver2, game);
            nodeUFL = new MyOcTreeNode(center + new Vector3(-sizeOver4, sizeOver4, -sizeOver4), sizeOver2, game);
            nodeUBR = new MyOcTreeNode(center + new Vector3(sizeOver4, sizeOver4, sizeOver4), sizeOver2, game);
            nodeUBL = new MyOcTreeNode(center + new Vector3(-sizeOver4, sizeOver4, sizeOver4), sizeOver2, game);
            nodeDFR = new MyOcTreeNode(center + new Vector3(sizeOver4, -sizeOver4, -sizeOver4), sizeOver2, game);
            nodeDFL = new MyOcTreeNode(center + new Vector3(-sizeOver4, -sizeOver4, -sizeOver4), sizeOver2, game);
            nodeDBR = new MyOcTreeNode(center + new Vector3(sizeOver4, -sizeOver4, sizeOver4), sizeOver2, game);
            nodeDBL = new MyOcTreeNode(center + new Vector3(-sizeOver4, -sizeOver4, sizeOver4), sizeOver2, game);
            childList.Add(nodeUFR);
            childList.Add(nodeUFL);
            childList.Add(nodeUBR);
            childList.Add(nodeUBL);
            childList.Add(nodeDFR);
            childList.Add(nodeDFL);
            childList.Add(nodeDBR);
            childList.Add(nodeDBL);
        }