libgdx/libgdx — pull request #350 by xoppa (2013-04-15 15:56:33+00:00)
Title: New3dapi: various changes

DefaultShader:
Check the vertex attributes on construction/canrender. I.e. the previous implementation assumed that a mesh had a normal attribute, which results in strange behaviour if it didnt. This solution is still not ideal (it only allows one attrbiute for each usage), but better than nothing.

MeshBuilder/MeshPartBuilder:
- Add setColor which is used for the color attribute (if available) and no vertex color is specified.
- Add primitiveType to begin and part, this allows to create multiple meshparts with different primitive types on the same mesh.
- Require a position attribute and add posSize/colSize, allowing 2d vetices and colors without alpha.
- Add hasPosition/hasNormal/hasColor/hasUV to VertexInfo.
- Add/modify some helper methods like line/triangle/rect and also by index. The sphere/cone/cylinder methods still need to be optimized though.

Tests:
- Add a base test with a grid/axes and only delegates the actual rendering for easy testing.
- Use MeshBuilder instead of ShapeRenderer so the mesh is cached.
- Add a base test which displays fps and allows to select a model for easy testing.
- Update NewModelTest to use that.

This should help for easier testing lighting/shaders.