mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
Merge pull request #1613 from thegrb93/box2d-update
Box2d update to 2.4.1
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user