Strip meshes are a type of polygon that can be loaded by HMD primitive packets. These meshes follow an identical structure to a triangle, except that a number is prefixed for the number of triangles (so 1 would mean there is no extra strip mesh data). After the identical packet data, repeat packets appear that again follow an identical format to triangles, with one exception that only one vertex is read.
The one awkward part of strip meshes was that you had to figure out the order for reading vertices and normals.
The order is vertex m + (0, 1, 2) / normal (0, 1, 2) for even indexes, and vertex m + (0, 2, 1) / normal (0, 2, 1) for odd packets. It was strange that normals weren't used in the order they were defined in, considering all normals are used from their respective mesh repeat packet.
packetStructure has been changed into the class PrimitiveData, which handles reading and dictionary lookup.
PrimitiveData now stores the PrimitiveType and RenderFlags, so they're no longer output by packet structure parsing functions.
This class holds a second dictionary when meshLength > 1, that holds repeated packets from strip meshes.
This can alternatively be changed to always use an array (even for index 0), but I figure this is probably the better approach for faster loading, since most primitives won't be strip meshes.
Some minor cleanup so that TMDParser calls AddTrianglesToGroup in the same way HMDParser does.
Changed the commented out printing of WriteLine(exp) in FileOffsetScanner to WriteErrorLine, for easier identifying.
This implements issue #64.
Strip meshes are a type of polygon that can be loaded by HMD primitive packets. These meshes follow an identical structure to a triangle, except that a number is prefixed for the number of triangles (so 1 would mean there is no extra strip mesh data). After the identical packet data, repeat packets appear that again follow an identical format to triangles, with one exception that only one vertex is read.
The one awkward part of strip meshes was that you had to figure out the order for reading vertices and normals.
The order is vertex
m + (0, 1, 2)
/ normal(0, 1, 2)
for even indexes, and vertexm + (0, 2, 1)
/ normal(0, 2, 1)
for odd packets. It was strange that normals weren't used in the order they were defined in, considering all normals are used from their respective mesh repeat packet.