Exemplo n.º 1
0
 public FatVertex(HodReader r, Int16 vertexFlags)
 {
     if ((vertexFlags & 1) != 0)            // 1 = HW2VF_VertexBit
     {
         Vertex = r.ReadVector4();
     }
     if ((vertexFlags & 4) != 0)            // 4 = HW2VF_ColourBit
     {
         Color = r.ReadInt32();
     }
     else
     {
         Color = -1;
     }
     if ((vertexFlags & 2) != 0)            // 2 = HW2VF_NormalBit
     {
         Normal = r.ReadVector4();
     }
     if ((vertexFlags & 8) != 0)            // 8 = Texture0Bit
     {
         Texture = r.ReadVector2();
     }
     if ((vertexFlags & 8192) != 0)            // TangentBit
     {
         Tangent = r.ReadVector3();
     }
     if ((vertexFlags & 16384) != 0)            // BinormalBit
     {
         Binormal = r.ReadVector3();
     }
 }
Exemplo n.º 2
0
 public Prim(HodReader r)
 {
     FaceType   = r.ReadInt16();
     NumIndices = r.ReadInt32();
     for (int i = 0; i < NumIndices; i++)
     {
         Indices[i] = r.ReadInt16();
     }
 }
Exemplo n.º 3
0
 public BmshChunk(HodReader r)
 {
     Kind      = "BMSH";
     Length    = 0;          // r.ReadInt32();
     MeshLod   = r.ReadInt32();
     NumMeshes = r.ReadInt32();
     Mesh      = new BmshGroup[NumMeshes];
     for (int i = 0; i < NumMeshes; i++)
     {
         Mesh[i] = new BmshGroup(r);
     }
 }
Exemplo n.º 4
0
 public BmshGroup(HodReader r)
 {
     MatIndex    = r.ReadInt32();
     VertexFlags = r.ReadInt16();             // XXX: May be longer?
     NumVerts    = r.ReadInt32();
     Verts       = new FatVertex[NumVerts];
     for (int i = 0; i < NumVerts; i++)
     {
         Verts[i] = new FatVertex(r, VertexFlags);
     }
     NumPrims = r.ReadInt16();
     Prims    = new Prim[NumPrims];
     for (int i = 0; i < NumPrims; i++)
     {
         Prims[i] = new Prim(r);
     }
 }
Exemplo n.º 5
0
        public SimpChunk(HodReader r)
        {
            Kind     = "SIMP";
            Length   = 0;
            Name     = r.ReadString();
            NumVerts = r.ReadInt32();
            Verts    = new SimpVert[NumVerts];
            for (int i = 0; i < NumVerts; i++)
            {
                Vector4 v = r.ReadVector4();
                Vector4 n = r.ReadVector4();
                Vector2 u = r.ReadVector2();
                Verts[i] = new SimpVert(v, n, u);
            }

            Faces = new Int32[NumFaces];
            for (int i = 0; i < NumFaces; i++)
            {
                Faces[i] = r.ReadInt32();
            }
        }
Exemplo n.º 6
0
 public NrmlChunk(HodReader r)
 {
     Kind     = "NRML";
     Length   = r.ReadInt32();
     Contents = r.ReadChunk();
 }
Exemplo n.º 7
0
 public VersChunk(HodReader r)
 {
     Kind    = "VERS";
     Version = r.ReadInt32();
 }
Exemplo n.º 8
0
 public FormChunk(HodReader r)
 {
     Kind     = "FORM";
     Length   = r.ReadInt32();
     Contents = r.ReadChunk();
 }
Exemplo n.º 9
0
 public HodChunk(HodReader r)
 {
 }
Exemplo n.º 10
0
 public BgmsChunk(HodReader r)
 {
     Kind     = "BGMS";
     Length   = 0;
     Contents = r.ReadChunk();
 }
Exemplo n.º 11
0
 public BgltChunk(HodReader r)
 {
     Kind   = "BGLT";
     Length = r.ReadInt32();
 }