love.physics: move internal box2d->love object map to World instances, and clean up some physics object code. Resolves issue #1465.

This commit is contained in:
Alex Szpakowski
2019-01-04 21:36:05 -04:00
parent 0752f27bdf
commit 3ad16a70da
20 changed files with 103 additions and 215 deletions
+2 -3
View File
@@ -23,7 +23,6 @@
// Module
#include "Body.h"
#include "World.h"
#include "common/Memoizer.h"
namespace love
{
@@ -69,7 +68,7 @@ Joint *GearJoint::getJointA() const
if (b2joint == nullptr)
return nullptr;
Joint *j = (Joint *) Memoizer::find(b2joint);
Joint *j = (Joint *) world->findObject(b2joint);
if (j == nullptr)
throw love::Exception("A joint has escaped Memoizer!");
@@ -82,7 +81,7 @@ Joint *GearJoint::getJointB() const
if (b2joint == nullptr)
return nullptr;
Joint *j = (Joint *) Memoizer::find(b2joint);
Joint *j = (Joint *) world->findObject(b2joint);
if (j == nullptr)
throw love::Exception("A joint has escaped Memoizer!");