public MetalKitEssentialsMesh(MTKMesh mtkMesh, MDLMesh mdlMesh, IMTLDevice device)
        {
            mesh = mtkMesh;
            submeshes = new List<MetalKitEssentialsSubmesh> ();

            if ((nuint)mtkMesh.Submeshes.Length != mdlMesh.Submeshes.Count)
                throw new Exception ("Number od submeshes should be equal");

            for (int i = 0; i < mtkMesh.Submeshes.Length; i++) {
                // Create our own app specifc submesh to hold the MetalKit submesh.
                var submesh = new MetalKitEssentialsSubmesh (mtkMesh.Submeshes[i], mdlMesh.Submeshes.GetItem <MDLSubmesh>((nuint)i), device);
                submeshes.Add (submesh);
            }
        }
Exemplo n.º 2
0
        public MetalKitEssentialsMesh(MTKMesh mtkMesh, MDLMesh mdlMesh, IMTLDevice device)
        {
            mesh      = mtkMesh;
            submeshes = new List <MetalKitEssentialsSubmesh> ();

            if ((nuint)mtkMesh.Submeshes.Length != mdlMesh.Submeshes.Count)
            {
                throw new Exception("Number od submeshes should be equal");
            }

            for (int i = 0; i < mtkMesh.Submeshes.Length; i++)
            {
                // Create our own app specifc submesh to hold the MetalKit submesh.
                var submesh = new MetalKitEssentialsSubmesh(mtkMesh.Submeshes[i], mdlMesh.Submeshes.GetItem <MDLSubmesh>((nuint)i), device);
                submeshes.Add(submesh);
            }
        }