Added Body:getWorld (resolves issue #895)

This commit is contained in:
Alex Szpakowski
2014-06-09 19:00:05 -03:00
parent 0c4116468c
commit 431b6a56ce
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -522,6 +522,15 @@ int w_Body_isFixedRotation(lua_State *L)
return 1;
}
int w_Body_getWorld(lua_State *L)
{
Body *t = luax_checkbody(L, 1);
World *world = t->getWorld();
world->retain();
luax_pushtype(L, "World", PHYSICS_WORLD_T, world);
return 1;
}
int w_Body_getFixtureList(lua_State *L)
{
Body *t = luax_checkbody(L, 1);
@@ -604,6 +613,7 @@ static const luaL_Reg functions[] =
{ "setAwake", w_Body_setAwake },
{ "setFixedRotation", w_Body_setFixedRotation },
{ "isFixedRotation", w_Body_isFixedRotation },
{ "getWorld", w_Body_getWorld },
{ "getFixtureList", w_Body_getFixtureList },
{ "destroy", w_Body_destroy },
{ "setUserData", w_Body_setUserData },
+1
View File
@@ -83,6 +83,7 @@ int w_Body_setActive(lua_State *L);
int w_Body_setAwake(lua_State *L);
int w_Body_setFixedRotation(lua_State *L);
int w_Body_isFixedRotation(lua_State *L);
int w_Body_getWorld(lua_State *L);
int w_Body_getFixtureList(lua_State *L);
int w_Body_destroy(lua_State *L);
int w_Body_setUserData(lua_State *L);