mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Starting box2d update
This commit is contained in:
@@ -47,56 +47,44 @@ void ChainShape::setNextVertex(float x, float y)
|
||||
{
|
||||
b2Vec2 v(x, y);
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
c->SetNextVertex(Physics::scaleDown(v));
|
||||
c->m_nextVertex = Physics::scaleDown(v);
|
||||
}
|
||||
|
||||
void ChainShape::setNextVertex()
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
c->m_hasNextVertex = false;
|
||||
}
|
||||
|
||||
void ChainShape::setPreviousVertex(float x, float y)
|
||||
{
|
||||
b2Vec2 v(x, y);
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
c->SetPrevVertex(Physics::scaleDown(v));
|
||||
c->m_prevVertex = Physics::scaleDown(v);
|
||||
}
|
||||
|
||||
void ChainShape::setPreviousVertex()
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
c->m_hasPrevVertex = false;
|
||||
}
|
||||
|
||||
bool ChainShape::getNextVertex(float &x, float &y) const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
|
||||
if (c->m_hasNextVertex)
|
||||
{
|
||||
b2Vec2 v = Physics::scaleUp(c->m_nextVertex);
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
b2Vec2 v = Physics::scaleUp(c->m_nextVertex);
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChainShape::getPreviousVertex(float &x, float &y) const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
|
||||
if (c->m_hasPrevVertex)
|
||||
{
|
||||
b2Vec2 v = Physics::scaleUp(c->m_prevVertex);
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
b2Vec2 v = Physics::scaleUp(c->m_prevVertex);
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
return true;
|
||||
}
|
||||
|
||||
EdgeShape *ChainShape::getChildEdge(int index) const
|
||||
|
||||
Reference in New Issue
Block a user