|
@@ -31,19 +31,12 @@ namespace box2d
|
|
|
|
|
|
int w_newWorld(lua_State * L)
|
|
|
{
|
|
|
- if (lua_gettop(L) < 4)
|
|
|
- return luaL_error(L, "Incorrect number of parameters");
|
|
|
-
|
|
|
- float lx = (float)luaL_checknumber(L, 1);
|
|
|
- float ly = (float)luaL_checknumber(L, 2);
|
|
|
- float ux = (float)luaL_checknumber(L, 3);
|
|
|
- float uy = (float)luaL_checknumber(L, 4);
|
|
|
- float gx = (float)luaL_optnumber(L, 5, 0);
|
|
|
- float gy = (float)luaL_optnumber(L, 6, 0);
|
|
|
- bool sleep = luax_optboolean(L, 7, true);
|
|
|
- int meter = (int)luaL_optnumber(L, 8, World::DEFAULT_METER);
|
|
|
+ float gx = (float)luaL_optnumber(L, 1, 0);
|
|
|
+ float gy = (float)luaL_optnumber(L, 2, 0);
|
|
|
+ bool sleep = luax_optboolean(L, 3, true);
|
|
|
+ int meter = (int)luaL_optnumber(L, 4, Physics::DEFAULT_METER);
|
|
|
|
|
|
- World * w = instance->newWorld(lx, ly, ux, uy, gx, gy, sleep, meter);
|
|
|
+ World * w = instance->newWorld(gx, gy, sleep, meter);
|
|
|
luax_newtype(L, "World", PHYSICS_WORLD_T, (void*)w);
|
|
|
|
|
|
return 1;
|