add sim.takeSnapshot lua function

This commit is contained in:
jacob1 2017-08-31 23:48:00 -04:00
parent be786d85a7
commit c34b54d974
2 changed files with 8 additions and 0 deletions

View File

@ -765,6 +765,7 @@ void LuaScriptInterface::initSimulationAPI()
{"neighbors", simulation_neighbours},
{"framerender", simulation_framerender},
{"gspeed", simulation_gspeed},
{"takeSnapshot", simulation_takeSnapshot},
{NULL, NULL}
};
luaL_register(l, "simulation", simulationAPIMethods);
@ -2143,6 +2144,12 @@ int LuaScriptInterface::simulation_gspeed(lua_State * l)
return 0;
}
int LuaScriptInterface::simulation_takeSnapshot(lua_State * l)
{
luacon_controller->HistorySnapshot();
return 0;
}
//// Begin Renderer API
void LuaScriptInterface::initRendererAPI()

View File

@ -108,6 +108,7 @@ class LuaScriptInterface: public CommandInterface
static int simulation_neighbours(lua_State * l);
static int simulation_framerender(lua_State * l);
static int simulation_gspeed(lua_State * l);
static int simulation_takeSnapshot(lua_State *l);
//Renderer
void initRendererAPI();