示例#1
0
        private async Task <Model> ParseModelAsync(dynamic model)
        {
            var idx = model.elements.data.indicies;

            int[] indicies = new int[idx.size];
            for (int i = 0; i < indicies.Length; i++)
            {
                indicies[i] = idx[i];
            }
            var stream   = new VertexStream(data.verticies.blocks[(int)model.vtx_block - 1].data);
            var material = await GetMaterialAsync((int)model.material);

            Model next   = null;
            long  offset = (long)model.next_offset;

            if (model.next != null)
            {
                if (CachedSubModels.ContainsKey(offset))
                {
                    next = CachedSubModels[offset];
                }
                else
                {
                    next = await ParseModelAsync(model.next);

                    CachedSubModels.Add(offset, next);
                }
            }

            return(new Mesh(next, material, indicies, stream));
        }
示例#2
0
 public Mesh(Model next, Material material, int[] indicies, VertexStream stream) : base(next, material)
 {
     Indicies = indicies;
     Stream   = stream;
 }