Merge: Intro parsers to load 3D models from .obj and .mtl files
authorJean Privat <jean@pryen.org>
Thu, 14 Jan 2016 20:47:48 +0000 (15:47 -0500)
committerJean Privat <jean@pryen.org>
Thu, 14 Jan 2016 20:47:48 +0000 (15:47 -0500)
commit12fb7a630bee066543c784ea0df38cf726069587
tree365dac1cc053cc1a30593f7514b0efd936d2c76f
parentc22509973c5b0e8a938097e3f7776ad5e048a86f
parent6efb4ef1249cd5bfb90cc41feac6d036ecd4c45a
Merge: Intro parsers to load 3D models from .obj and .mtl files

Intro parsers to load 3D models from the ASCII based format of .obj and .mtl files. Also as support intro a new kind of asset, `app::TextAsset`, with lazy loading in the style of `Sound` and `Texture`.

Model parsing services will be used by the 3D API of gamnit to load 3D models generated by modeler tools like Blender.

The services in `gamnit::model_parsers` are independent of gamnit. However since they are game related, it is a nice package to classify them in. They still can be used by any other 3D graphics engine, as `gamnit::network` which is also independent but game oriented. This adds a small duplication in their representation because a model is stored differently once loaded in gamnit. But the format in gamnit is so low-level (only arrays of Float) that we need an intermediate representation to triangulate faces and stuff like that.

Services of `model_parser_base` may be moved to other modules in the future as needed. The services added to `StringProcessor`, may be useful to other parsers and thus it could be moved up to `parser_base`. `Vec3` and `Vec4` apply an API similar to `vec3 & vec4` of GLSL. I may move them up to gamnit or glesv2 and add more services to transform from and to points, colors and other float based data vectors.

Pull-Request: #1918
Reviewed-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>