Beispiel #1
0
        public override T GetChunkAtLocalPosition(int[] pos)
        {
            IChunkGroupOrganizer <T> child = children[GetIndexForLocalPosition(pos)];

            pos[0] -= groupRelativeAnchorPosition[0];
            pos[1] -= groupRelativeAnchorPosition[1];
            pos[2] -= groupRelativeAnchorPosition[2];
            return(child.GetChunkAtLocalPosition(pos));
        }
Beispiel #2
0
        public void PrepareBranchDestruction(List <CompressedMarchingCubeChunk> allLeafs)
        {
            for (int i = 0; i < 8; i++)
            {
                IChunkGroupOrganizer <CompressedMarchingCubeChunk> child = children[i];
                if (child == null)
                {
                    continue;
                }

                if (child is ChunkGroupTreeLeaf l)
                {
                    l.leaf.PrepareDestruction();
                    allLeafs.Add(l.leaf);
                }
                else
                {
                    ((IChunkGroupParent <ChunkGroupTreeLeaf>)child).PrepareBranchDestruction(allLeafs);
                }
            }
        }