Esempio n. 1
0
            internal void Update()
            {
                if (!IsUsed())
                {
                    return;
                }

                bool invalidateLod = false;

                foreach (var proxyIndex in m_dirtyProxyIndices)
                {
                    var cellProxy = m_mergedLodMeshProxies[proxyIndex];
                    if (MyMeshes.CanStartMerge(cellProxy.MeshId, 1))
                    {
                        Vector3I          mergeCell   = MyMeshes.GetVoxelInfo(cellProxy.MeshId).Coord;
                        int               divideIndex = GetDivideIndexFromMergeCell(ref mergeCell);
                        MyMergedLodMeshId mergedId    = MyMeshes.GetMergedLodMesh(cellProxy.MeshId, 0);
                        invalidateLod |= mergedId.Info.MergedLodMeshes.Count > 0;
                        mergedId.Info.PendingLodMeshes.UnionWith(mergedId.Info.MergedLodMeshes);
                        mergedId.Info.MergedLodMeshes.Clear();

                        TryCancelMergeJob(divideIndex, MeshId.NULL);
                        TryStartMergeJob(divideIndex, 1);
                    }
                }
                m_dirtyProxyIndices.Clear();
                if (invalidateLod)
                {
                    InvalidateAllMergedMeshesInLod();
                }
            }