public void readVertexList(Matrix4x4 mat) { var vtxe = ReadNjVtxe(streamReader, be); streamReader.Seek(vtxe.vertexListOffset, SeekOrigin.Begin); var vtxl = new VTXL(); bool readUv = false; bool readNormal = false; bool readColor = false; int size = (int)vtxe.vertexSize; //pos size -= 0xC; //Process bitflags if ((vtxe.vertexType & 0x01) != 0) { readUv = true; size -= 0x8; } if ((vtxe.vertexType & 0x02) != 0) { readNormal = true; size -= 0xC; } if ((vtxe.vertexType & 0x04) != 0) { readColor = true; size -= 0x4; } if (size != 0) { Console.WriteLine($"Vert size is not 0 at vtxe {(streamReader.Position() - 0x10).ToString("X")}"); } //Read vertices for (int i = 0; i < vtxe.vertexCount; i++) { var pos = streamReader.ReadBEV3(be) * rootScale; var newPos = Vector3.Transform(pos, mat); vtxl.vertPositions.Add(newPos); if (readNormal) { var nrm = streamReader.ReadBEV3(be); var newNrm = Vector3.TransformNormal(nrm, mat); vtxl.vertNormals.Add(newNrm); } if (readColor) { byte[] color = new byte[4]; color[0] = streamReader.Read <byte>(); color[1] = streamReader.Read <byte>(); color[2] = streamReader.Read <byte>(); color[3] = streamReader.Read <byte>(); vtxl.vertColors.Add(color); } if (readUv) { vtxl.uv1List.Add(streamReader.ReadBEV2(be)); } //skip unexpected sections if (size > 0) { streamReader.Seek(size, SeekOrigin.Current); } } aqObj.vtxlList.Add(vtxl); }