mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Added Body/Contact/Fixture/Joint/World:isDestroyed (resolves issue #964.)
This commit is contained in:
@@ -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 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user