34 if (data.size() !=
DIM)
36 std::string
err =
"Wrong number of elements to LuaArray<"+std::to_string(
DIM)+
">, " + std::to_string(data.size());
39 throw std::runtime_error(
err);
100 operator std::array<double, DIM>() {
return elements; }
glm::vec< L, float, glm::qualifier::highp > vec
Definition commandLine.h:214
std::vector< double > getNumericLuaTable(lua_State *lua, int index)
Get the a Lua table of doubles.
Definition lua.h:24
Interop for a fixed size numeric array in Lua.
Definition LuaArray.h:15
std::array< double, DIM > elements
Definition LuaArray.h:102
double & operator[](size_t i)
Definition LuaArray.h:98
bool readGlobal(lua_State *lua, const char *name)
Read the array from a global table field.
Definition LuaArray.h:81
void read(lua_State *lua, int index)
Read the array from stack index index.
Definition LuaArray.h:31
bool readField(lua_State *lua, const char *name)
Read the array from a table field.
Definition LuaArray.h:56
LuaArray()
Construct an array of 0s.
Definition LuaArray.h:20