   How to return a table form a luabind function?
  I know how to read tables from a luabind object but how do I return a table from a function?[Edited by - CodaKiller on May 20, 2009 12:15:22 PM]
  I've been looking really hard to find the answer and there is almost no information on this.This is exactly what I'm trying to do, I have a scene desc class that simply needs to return the gravity from a cml vector in the class but in the script I'm not using a class for vectors, I'm using tables since it makes the code simpler.Here is the source for the class:class E_SCENE_DESC{public:    void set_gravity(luabind::object vec){gravity = cml::vector3f( luabind::object_cast<float>(vec[1]), luabind::object_cast<float>(vec[2]), luabind::object_cast<float>(vec[3]) );}    luabind::object get_gravity() const{return ??; // How do I return the gravity as a table?!}cml::vector3f gravity;};;luabind::object table = luabind::newtable( luaState );table[1] = luabind::object();return table; [Edited by - Neverender on May 20, 2009 7:50:57 PM];Quote:Original post by Neverender *** Source Snippet Removed ***It worked thank you, I would have never thought I could just create a table and set the values without setting the size of the table.   