#include #include #include #include "import.h" static void push_vector(lua_State *L, struct aiVector3D vec) { hs_create_table(L, hs_str_num("x", vec.x), hs_str_num("y", vec.y), hs_str_num("z", vec.z), ); } static void push_face(lua_State *L, struct aiFace face) { lua_createtable(L, face.mNumIndices, 0); int tbl = lua_gettop(L); for (int i=0; imMeshes != NULL) { lua_createtable(L, node->mNumMeshes, 0); int meshes = lua_gettop(L); for (int i=0; imNumMeshes; i++) { lua_pushinteger(L, node->mMeshes[i]+1); lua_rawseti(L, meshes, i+1); } lua_setfield(L, nodetbl, "meshes"); } if (node->mChildren != NULL) { lua_createtable(L, node->mNumChildren, 0); int children = lua_gettop(L); for (int i=0; imNumChildren; i++) { push_node(L, node->mChildren[i]); lua_rawseti(L, children, i+1); } lua_setfield(L, nodetbl, "children"); } } static void push_scene(lua_State *L, struct aiNode *node) { }