Example #1
0
 static Node DeepSplit(Context context, ReconciliationData reconciliationData, Node node)
 {
     if (ShouldSplit(context, reconciliationData, node))
     {
         int ordinal = GetChildOrdinal(reconciliationData.pointInPlane, node.offset, node.depth.scale);
         return(DeepSplit(context, reconciliationData, EnsureChild(context, node, ordinal)));
     }
     else
     {
         return(node);
     }
 }
Example #2
0
        public static void Reconcile(Context context, ReconciliationData reconciliationData)
        {
            HashSet <Node> marked = new HashSet <Node>();

            MarkRoots(context, marked);

            // Perform deep split.
            Node root = context.roots[reconciliationData.branch.index];
            Node leaf = DeepSplit(context, reconciliationData, root);

            marked.Add(leaf);

            context.constants.plugins.ModifyMarkedSet(context, marked, leaf);

            // Mark nodes to create a balanced tree (max 2:1 split between neighbors).
            MarkBalancedNodes(context, marked);

            PerformMarkAndSweep(context, marked);
        }
Example #3
0
        void Update()
        {
            if (dirty)
            {
                dirty = false;
                DoCleanup();
                DoUpdate();
            }

            if (playerCamera == null || playerCamera.gameObject != player)
            {
                playerCamera = player.GetComponent <Camera>();
            }

            Core.ReconciliationData reconciliationData = Core.ReconciliationData.GetData(context, playerCamera);
            if (reconciliationData == null)
            {
                return;
            }

            Core.Reconciler.Reconcile(context, reconciliationData);
        }
Example #4
0
 static bool ShouldSplit(Context context, ReconciliationData reconciliationData, Node node)
 {
     return(node.path.Length < context.constants.maxDepth &&
            node.depth.approximateSize > reconciliationData.desiredLength);
 }