Import box2d-contacts branch from love-experiments

Fix issues with Contact lifetime, based on the work of
Matteo "teomat" Goggi
This commit is contained in:
Boolsheet
2012-07-24 23:59:42 +02:00
parent 82d6edb32c
commit cde5aa3307
4 changed files with 56 additions and 16 deletions
+15 -1
View File
@@ -39,7 +39,21 @@ Contact::Contact(b2Contact *contact)
Contact::~Contact()
{
Memoizer::remove(contact);
invalidate();
}
void Contact::invalidate()
{
if (contact != NULL)
{
Memoizer::remove(contact);
contact = NULL;
}
}
bool Contact::isValid()
{
return contact != NULL ? true : false;
}
int Contact::getPositions(lua_State *L)