Merge pull request #1613 from thegrb93/box2d-update

Box2d update to 2.4.1
This commit is contained in:
Alex Szpakowski
2020-11-02 21:27:57 -04:00
committed by GitHub
185 changed files with 11192 additions and 9207 deletions
+6 -6
View File
@@ -45,7 +45,7 @@ Body::Body(World *world, b2Vec2 p, Body::Type type)
udata->ref = nullptr;
b2BodyDef def;
def.position = Physics::scaleDown(p);
def.userData = (void *) udata;
def.userData.pointer = (uintptr_t)udata;
body = world->world->CreateBody(&def);
// Box2D body holds a reference to the love Body.
this->retain();
@@ -385,9 +385,9 @@ void Body::setBullet(bool bullet)
return body->SetBullet(bullet);
}
bool Body::isActive() const
bool Body::isEnabled() const
{
return body->IsActive();
return body->IsEnabled();
}
bool Body::isAwake() const
@@ -405,9 +405,9 @@ bool Body::isSleepingAllowed() const
return body->IsSleepingAllowed();
}
void Body::setActive(bool active)
void Body::setEnabled(bool enabled)
{
body->SetActive(active);
body->SetEnabled(enabled);
}
void Body::setAwake(bool awake)
@@ -544,7 +544,7 @@ int Body::setUserData(lua_State *L)
if (udata == nullptr)
{
udata = new bodyudata();
body->SetUserData((void *) udata);
body->GetUserData().pointer = (uintptr_t)udata;
}
if(!udata->ref)