コード例 #1
0
 public BF2CollisionMeshColData(Stream s, uint version)
 {
     if (version >= 9)
     {
         colType = Helper.ReadU32(s);
     }
     numFaces = Helper.ReadU32(s);
     faces    = new List <ushort[]>();
     for (int i = 0; i < numFaces; i++)
     {
         ushort[] tmp = new ushort[4];
         for (int j = 0; j < 4; j++)
         {
             tmp[j] = Helper.ReadU16(s);
         }
         faces.Add(tmp);
     }
     numVertices = Helper.ReadU32(s);
     vertices    = new List <BF2MeshVector3>();
     for (int i = 0; i < numVertices; i++)
     {
         vertices.Add(new BF2MeshVector3(s));
     }
     u1 = new ushort[numVertices];
     for (int i = 0; i < numVertices; i++)
     {
         u1[i] = Helper.ReadU16(s);
     }
     boundsMin1 = new BF2MeshVector3(s);
     boundsMax1 = new BF2MeshVector3(s);
     u2         = (byte)s.ReadByte();
     boundsMin2 = new BF2MeshVector3(s);
     boundsMax2 = new BF2MeshVector3(s);
     numY       = Helper.ReadU32(s);
     dataY      = new List <uint[]>();
     for (int i = 0; i < numY; i++)
     {
         uint[] tmp = new uint[4];
         for (int j = 0; j < 4; j++)
         {
             tmp[j] = Helper.ReadU32(s);
         }
         dataY.Add(tmp);
     }
     numZ  = Helper.ReadU32(s);
     dataZ = new ushort[numZ];
     for (int i = 0; i < numZ; i++)
     {
         dataZ[i] = Helper.ReadU16(s);
     }
     if (version >= 10)
     {
         numA  = Helper.ReadU32(s);
         dataA = new uint[numA];
         for (int i = 0; i < numA; i++)
         {
             dataA[i] = Helper.ReadU32(s);
         }
     }
 }
コード例 #2
0
 public BF2MeshSKMLod(Stream s, uint version)
 {
     u1 = new BF2MeshVector3(s);
     u2 = new BF2MeshVector3(s);
     if (version == 4)
     {
         u3 = new BF2MeshVector3(s);
     }
     numRigs = Helper.ReadU32(s);
     rigs    = new List <BF2MeshRig>();
     for (int i = 0; i < numRigs; i++)
     {
         rigs.Add(new BF2MeshRig(s));
     }
 }
コード例 #3
0
 public BF2MeshSTMLod(Stream s, BF2MeshHeader header)
 {
     u1 = new BF2MeshVector3(s);
     u2 = new BF2MeshVector3(s);
     if (header.version == 4)
     {
         u3 = new BF2MeshVector3(s);
     }
     numNodes = Helper.ReadU32(s);
     nodes    = new List <BF2MeshMatrix>();
     for (int i = 0; i < numNodes; i++)
     {
         nodes.Add(new BF2MeshMatrix(s));
     }
 }
コード例 #4
0
 public BF2MeshSTMMaterial(Stream s, BF2MeshHeader header)
 {
     alphaMode       = Helper.ReadU32(s);
     shaderFile      = Helper.ReadCString(s);
     technique       = Helper.ReadCString(s);
     numTextureMaps  = Helper.ReadU32(s);
     textureMapFiles = new List <string>();
     for (int i = 0; i < numTextureMaps; i++)
     {
         textureMapFiles.Add(Helper.ReadCString(s));
     }
     vertexStartIndex   = Helper.ReadU32(s);
     indiciesStartIndex = Helper.ReadU32(s);
     numIndicies        = Helper.ReadU32(s);
     numVertices        = Helper.ReadU32(s);
     u1 = Helper.ReadU32(s);
     u2 = Helper.ReadU16(s);
     u3 = Helper.ReadU16(s);
     if (header.version == 0xB)
     {
         u4 = new BF2MeshVector3(s);
         u5 = new BF2MeshVector3(s);
     }
 }
コード例 #5
0
 public BF2MeshBMLod(Stream s, BF2MeshHeader header)
 {
     if (header.version == 6)
     {
         u1 = new BF2MeshVector3(s);
         u2 = new BF2MeshVector3(s);
         u3 = new BF2MeshVector3(s);
         u4 = Helper.ReadU32(s);
     }
     if (header.version == 10)
     {
         u1 = new BF2MeshVector3(s);
         u2 = new BF2MeshVector3(s);
         u4 = Helper.ReadU32(s);
         if (header.u5 == 1)
         {
             u5 = new List <BoneEntry>();
             for (int i = 0; i < u4; i++)
             {
                 u5.Add(new BoneEntry(new BF2MeshMatrix(s), Helper.ReadCString(s)));
             }
         }
     }
 }