Memoize Contacts, and add List-fetching functions to World (they return arrays)

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-09-24 16:46:07 -04:00
parent f852c9bac2
commit 6a0c5b485b
5 changed files with 114 additions and 0 deletions
+4
View File
@@ -22,6 +22,8 @@
#include "World.h"
#include "Physics.h"
#include <common/Memoizer.h>
namespace love
{
namespace physics
@@ -31,10 +33,12 @@ namespace box2d
Contact::Contact(b2Contact * contact)
: contact(contact)
{
Memoizer::add(contact, this);
}
Contact::~Contact()
{
Memoizer::remove(contact);
}
int Contact::getPositions(lua_State * L)