Esempio n. 1
0
        private static MDLMesh ReadMesh(BinaryReader br, int offset)
        {
            br.BaseStream.Seek(offset, SeekOrigin.Begin);
            MDLMesh_t mesh_t = new MDLMesh_t();
            mesh_t.material_index = br.ReadInt32();
            mesh_t.model_index = br.ReadInt32();

            mesh_t.num_vertices = br.ReadInt32();
            mesh_t.vertex_offset = br.ReadInt32();

            mesh_t.num_flexes = br.ReadInt32();
            mesh_t.flex_offset = br.ReadInt32();

            mesh_t.material_type = br.ReadInt32();
            mesh_t.material_param = br.ReadInt32();

            mesh_t.mesh_id = br.ReadInt32();

            mesh_t.mesh_center = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            mesh_t.vertex_data = new MDLMeshVertexData();
            mesh_t.vertex_data.model_vertex_data_ptr = br.ReadInt32();
            mesh_t.vertex_data.num_lod_vertices = new int[8];
            for (int i = 0; i < 8; i++)
            {
                mesh_t.vertex_data.num_lod_vertices[i] = br.ReadInt32();
            }

            mesh_t.unused_array = new int[8]; // 8
            for (int i = 0; i < 8; i++)
            {
                mesh_t.unused_array[i] = br.ReadInt32();
            }

            MDLMesh mesh = new MDLMesh(mesh_t, srcModel, materials[mesh_t.material_index]);
            return mesh;
        }
Esempio n. 2
0
 //public SourceMaterial material;
 public MDLMesh(MDLMesh_t mesh, RenderChildren parent, SourceMaterial material)
     : base(parent, material)
 {
     this.mesh = mesh;
 }