I tore myself away from the PS3 this weekend just long enough to finish this latest little mini-project: using Lua as a data file format. Here's my minimal test file:
DRONMesh {
name = "Triangle",
verts = {
{ 0.0, 0.5, 0.5 },
{ 0.5, -0.5, 0.5 },
{ -0.5, -0.5, 0.5 }
},
tris = {
{ 0, 1, 2 }
}
}
I said it was pretty minimal ;)
Anyway, DRONMesh is a lua function that creates a new Mesh object, populates it with the data given in the table, and registers it with the resource manager. I need to expand it to handle materials, bones and whatnot, but I'm happy that I got it working. I haven't stress tested it in any way, but all the models in my game are fairly small (< 100 vertices), so I'm not too worried about long load times.
The reason I ask is that I always have trouble determining the right mixture of one over the other - the flexibility of Lua is great, but at some point you need to use the C++ code you have already written