Exemplo n.º 1
0
        public MeshContext ReadMesh(ImporterContext ctx, int meshIndex)
        {
            var gltfMesh = ctx.GLTF.meshes[meshIndex];

            var meshContext = new MeshContext(gltfMesh.name, meshIndex);

            if (HasSharedVertexBuffer(gltfMesh))
            {
                meshContext.ImportMeshSharingVertexBuffer(ctx, gltfMesh);
            }
            else
            {
                meshContext.ImportMeshIndependentVertexBuffer(ctx, gltfMesh);
            }

            meshContext.RenameBlendShape(gltfMesh);

            meshContext.DropUnusedVertices();

            return(meshContext);
        }
Exemplo n.º 2
0
        internal MeshContext ReadMesh(GltfData data, int meshIndex, IAxisInverter inverter)
        {
            Profiler.BeginSample("ReadMesh");
            var gltfMesh = data.GLTF.meshes[meshIndex];

            var meshContext = new MeshContext(gltfMesh.name, meshIndex);

            if (HasSharedVertexBuffer(gltfMesh))
            {
                meshContext.ImportMeshSharingVertexBuffer(data, gltfMesh, inverter);
            }
            else
            {
                meshContext.ImportMeshIndependentVertexBuffer(data, gltfMesh, inverter);
            }

            meshContext.RenameBlendShape(gltfMesh);

            meshContext.DropUnusedVertices();

            Profiler.EndSample();
            return(meshContext);
        }