public CurvedPolyMeshItem[] GetItem(LoDs lods)
 {
     if (tessellationModels.ContainsKey(lods))
     {
         return(tessellationModels[lods]);
     }
     return(null);
 }
 public TessellationOutput GetTessellationOutput(LoDs lods, int index)
 {
     if (tessellationModels.ContainsKey(lods))
     {
         CurvedPolyMeshItem[] items = tessellationModels[lods];
         return(this.curvedPolyVariants.GetTessellationOutput(items[index].id));
     }
     return(null);
 }
 public void ClearMeshes(LoDs lods)
 {
     CurvedPolyMeshItem[] items = GetItem(lods);
     if (items != null)
     {
         for (int i = 0; i < items.Length; i++)
         {
             items[i].storedMesh = null;
         }
     }
 }
 public void RecomputeShape(LoDs lods, int index, CPNSubset cpnSubset = null)
 {
     CurvedPolyMeshItem[] items = tessellationModels[lods];
     if (items != null)
     {
         if (index < items.Length && items[index].WasGenerated())
         {
             short[] loqs = lods.availableLoqs[index].values;
             items[index].UpdateTessellationItem(loqs, cpnSubset);
         }
     }
 }
 public void InitLods(LoDs lods)
 {
     if (!tessellationModels.ContainsKey(lods))
     {
         CurvedPolyMeshItem[] items = new CurvedPolyMeshItem[lods.availableLoqs.Count];
         for (int i = 0; i < items.Length; i++)
         {
             items[i] = new CurvedPolyMeshItem(curvedPolyVariants);
         }
         tessellationModels[lods] = items;
     }
 }
        public Mesh GetMesh(LoDs lods, int index, bool dynamicMode, Mesh input = null)
        {
            InitLods(lods);

            CurvedPolyMeshItem[] items = tessellationModels[lods];

            if (items[index].storedMesh != null && !dynamicMode && !items[index].NeedUpdate())
            {
                return(items[index].storedMesh);
            }
            else
            {
                short[] loqs = lods.availableLoqs[index].values;

                if (input != null && input != items[index].storedMesh)
                {
                    items[index].storedMesh = input;
                    if (dynamicMode)
                    {
                        items[index].storedMesh.MarkDynamic();
                    }
                }

                if (items[index].storedMesh == null)
                {
                    items[index].storedMesh = new Mesh();
                    if (dynamicMode)
                    {
                        items[index].storedMesh.MarkDynamic();
                    }
                }

                if (items[index].NeedUpdate())
                {
                    items[index].AsTessellationItem(loqs);
                }

                return(items[index].storedMesh);
            }
        }
 public void ClearMeshes(LoDs lods)
 {
     meshItemDB.ClearMeshes(lods);
 }
        public Mesh GetMesh(LoDs lods, int lodsIndex, bool dynamicMode, Mesh input = null)
        {
            Mesh mesh = meshItemDB.GetMesh(lods, lodsIndex, dynamicMode, input /*, useUnityNormals*/);

            return(mesh);
        }
 public void RecomputeShape(LoDs lods, int lodsIndex, CPNSubset subset)
 {
     meshItemDB.RecomputeShape(lods, lodsIndex, subset);
 }
 public TessellationOutput GetTessellationOutput(LoDs lods, int index)
 {
     return(meshItemDB.GetTessellationOutput(lods, index));
 }