public TemplateCollection(ModelFactory factory, IList <IGeometryModel> lods)
            {
                this.factory  = factory;
                LodProperties = lods.Select(g => new ModelProperties(g)).ToList();

                for (int i = 0; i < lods.Count; i++)
                {
                    var lod = lods[i];

                    var meshIndexes = lod.Regions
                                      .SelectMany(r => r.Permutations)
                                      .SelectMany(p => Enumerable.Range(p.MeshIndex, p.MeshCount))
                                      .Distinct();

                    var meshes = new MeshTemplate[lod.Meshes.Count];
                    foreach (var index in meshIndexes)
                    {
                        meshes[index] = MeshTemplate.FromModel(lod, index);
                    }

                    templates.Add(i++, meshes);
                }
            }
Esempio n. 2
0
 protected MeshTemplate(MeshTemplate copy)
 {
     submeshCount = copy.submeshCount;
     matIndex     = copy.matIndex;
     submeshes    = copy.submeshes;
 }