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(); } }
public Prim(HodReader r) { FaceType = r.ReadInt16(); NumIndices = r.ReadInt32(); for (int i = 0; i < NumIndices; i++) { Indices[i] = r.ReadInt16(); } }
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); } }
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); } }
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(); } }
public NrmlChunk(HodReader r) { Kind = "NRML"; Length = r.ReadInt32(); Contents = r.ReadChunk(); }
public VersChunk(HodReader r) { Kind = "VERS"; Version = r.ReadInt32(); }
public FormChunk(HodReader r) { Kind = "FORM"; Length = r.ReadInt32(); Contents = r.ReadChunk(); }
public HodChunk(HodReader r) { }
public BgmsChunk(HodReader r) { Kind = "BGMS"; Length = 0; Contents = r.ReadChunk(); }
public BgltChunk(HodReader r) { Kind = "BGLT"; Length = r.ReadInt32(); }