Beispiel #1
0
 public SdkMesh(string filename)
 {
     using (var reader = new BinaryReader(new FileStream(filename, FileMode.Open))) {
         _header = new SdkMeshHeader(reader);
         for (int i = 0; i < _header.NumVertexBuffers; i++)
         {
             VertexBuffers.Add(new SdkMeshVertexBuffer(reader));
         }
         for (int i = 0; i < _header.NumIndexBuffers; i++)
         {
             IndexBuffers.Add(new SdkMeshIndexBuffer(reader));
         }
         for (int i = 0; i < _header.NumMeshes; i++)
         {
             Meshes.Add(new SdkMeshMesh(reader));
         }
         for (int i = 0; i < _header.NumTotalSubsets; i++)
         {
             Subsets.Add(new SdkMeshSubset(reader));
         }
         for (int i = 0; i < _header.NumFrames; i++)
         {
             Frames.Add(new SdkMeshFrame(reader));
         }
         for (int i = 0; i < _header.NumMaterials; i++)
         {
             Materials.Add(new SdkMeshMaterial(reader));
         }
     }
 }
Beispiel #2
0
 public SdkMesh(string filename) {
     using (var reader = new BinaryReader(new FileStream(filename, FileMode.Open))) {
         _header = new SdkMeshHeader(reader);
         for (int i = 0; i < _header.NumVertexBuffers; i++) {
             VertexBuffers.Add(new SdkMeshVertexBuffer(reader));
         }
         for (int i = 0; i < _header.NumIndexBuffers; i++) {
             IndexBuffers.Add(new SdkMeshIndexBuffer(reader));
         }
         for (int i = 0; i < _header.NumMeshes; i++) {
             Meshes.Add(new SdkMeshMesh(reader));
         }
         for (int i = 0; i < _header.NumTotalSubsets; i++) {
             Subsets.Add(new SdkMeshSubset(reader));
         }
         for (int i = 0; i < _header.NumFrames; i++) {
             Frames.Add(new SdkMeshFrame(reader));
         }
         for (int i = 0; i < _header.NumMaterials; i++) {
             Materials.Add(new SdkMeshMaterial(reader));
         }
     }
 }