Put in the Mesh class all the info wee need
Very much like we did in the Custom Content Processing post, we are going to use the “Tag” property of a mesh to store what we want, which in this case is something like this:
When VisualStudio passes every model through our ContentProcessor, it will write the model´s data to an XNB file. When it finds a MeshData object, will search for a writer that is able to serialize it, so we have to write our custom ContentTypeWriter for the MeshData class:
In a similar way, when the ContentPipeline tries to read back the XNB file, it will search for a deserializer for the type MeshData, so we have to write our own ContentTypeReader:
Finally, our Custom Content Processor that fills up the MeshData objects for each model goes through it:
Note: some parts taken from ZiggyWare:
In the next chapter will focus on the Collision Detection implementation using all this info. Cheers !