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
@@ -151,6 +151,13 @@ int w_Contact_getFixtures(lua_State *L)
return 2;
}
int w_Contact_isDestroyed(lua_State *L)
{
Contact *c = luax_checktype<Contact>(L, 1, "Contact", PHYSICS_CONTACT_T);
luax_pushboolean(L, !c->isValid());
return 1;
}
extern "C" int luaopen_contact(lua_State *L)
{
static const luaL_Reg functions[] =
@@ -170,6 +177,7 @@ extern "C" int luaopen_contact(lua_State *L)
{ "getTangentSpeed", w_Contact_getTangentSpeed },
{ "getChildren", w_Contact_getChildren },
{ "getFixtures", w_Contact_getFixtures },
{ "isDestroyed", w_Contact_isDestroyed },
{ 0, 0 }
};