|
I use Vec3 and Quat types from the stack. My Lua/C++ bindings take and return tables. I do this because many libraries dealing with graphics (OpenGL etc.) take tables as arguments and I want to be able to pass a Vec3 into functions like gl.Vertex() without a conversion from a udata. Here's a typical function:
Tables have the same problem as userdata, since they are dynamically allocated. Well, they are a little nicer to the garbage collector since they can't have __gc metamethods... but I have already patched Lua to address that problem :)
// Niklas