Added Body/Contact/Fixture/Joint/World:isDestroyed (resolves issue #964.)

This commit is contained in:
Alex Szpakowski
2015-01-05 00:14:41 -04:00
parent be9b5b5d1a
commit 91062a1496
21 changed files with 56 additions and 0 deletions
+8
View File
@@ -564,6 +564,13 @@ int w_Body_destroy(lua_State *L)
return 0;
}
int w_Body_isDestroyed(lua_State *L)
{
Body *b = luax_checktype<Body>(L, 1, "Body", PHYSICS_BODY_T);
luax_pushboolean(L, b->body == nullptr);
return 1;
}
int w_Body_setUserData(lua_State *L)
{
Body *t = luax_checkbody(L, 1);
@@ -635,6 +642,7 @@ static const luaL_Reg functions[] =
{ "getJointList", w_Body_getJointList },
{ "getContactList", w_Body_getContactList },
{ "destroy", w_Body_destroy },
{ "isDestroyed", w_Body_isDestroyed },
{ "setUserData", w_Body_setUserData },
{ "getUserData", w_Body_getUserData },
{ 0, 0 }