Closed JohnGrime closed 5 years ago
Hi Tobias,
I've tweaked a few things in your code, and added some basic support for textures and large meshes (i.e., > 2^16 vertices).
Thanks for creating this!
Cheers,
J.
Okay, hopefully I caught all of them!
Moved data extraction from XML attributes into Tools class, joining similar routines to process string data that were already there.
X3DImporter class:
Now non-static, so can import more than one X3D object without e.g. getting confused by previous entries into the DEF map etc; this should not happen, but I've changed it anyway out of an abundance of caution.
I've tried to avoid passing GameObjects into routines to be modified; instead, I try to return data structures for collation/application to game objects in fewer locations so it's easier to see exactly what is modified and when. This also allows us to defer changes in some cases until we have collected other information that may be relevant.
ReadX3D() returns scene GameObject, and the processed XmlDocument; the latter is important if we want to modify the X3D file and save the results in as close to the original form as possible.
Reworked ReadIndexedFaceSet(); now handles meshes with > 2^16 vertices by creating child objects for each (sub-)mesh.
Added rudimentary texture support. This can require some notion of what the current directory path is, so some routines now have a "filepathPrefix" parameter.