Пример #1
0
 public CreateDataJob(Bounds VolumnBound, int mx, int mz, MeshLODCreate[] setting)
 {
     LODs = new MTTerrainScanner[setting.Length];
     for (int i = 0; i < setting.Length; ++i)
     {
         MeshLODCreate s = setting[i];
         //only first lod stitch borders, other lod use the most detailed border to avoid
         //tearing on the border
         LODs[i] = new MTTerrainScanner(VolumnBound, s.Subdivision, s.SlopeAngleError, mx, mz,
                                        i == 0);
     }
 }
Пример #2
0
        public void EndProcess()
        {
            //copy borders
            MTTerrainScanner detail = LODs[0];

            detail.FillData();
            for (int i = 1; i < LODs.Length; ++i)
            {
                MTTerrainScanner scaner = LODs[i];
                for (int t = 0; t < detail.Trees.Length; ++t)
                {
                    SamplerTree dt = detail.Trees[t];
                    SamplerTree lt = scaner.Trees[t];
                    foreach (var b in dt.Boundaries)
                    {
                        lt.Boundaries.Add(b.Key, b.Value);
                    }
                }
                scaner.FillData();
            }
        }