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 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(); } }