mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Added ChainShape:getNext/PreviousVertex (see issue #1191). Thanks airstruck!
This commit is contained in:
@@ -67,6 +67,32 @@ void ChainShape::setPreviousVertex(float x, float y)
|
||||
c->SetPrevVertex(Physics::scaleDown(v));
|
||||
}
|
||||
|
||||
bool ChainShape::hasNextVertex() const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
return c->m_hasNextVertex;
|
||||
}
|
||||
|
||||
bool ChainShape::hasPreviousVertex() const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
return c->m_hasPrevVertex;
|
||||
}
|
||||
|
||||
b2Vec2 ChainShape::getNextVertex() const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
const b2Vec2 &v = c->m_nextVertex;
|
||||
return Physics::scaleUp(v);
|
||||
}
|
||||
|
||||
b2Vec2 ChainShape::getPreviousVertex() const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
const b2Vec2 &v = c->m_prevVertex;
|
||||
return Physics::scaleUp(v);
|
||||
}
|
||||
|
||||
EdgeShape *ChainShape::getChildEdge(int index) const
|
||||
{
|
||||
b2ChainShape *c = (b2ChainShape *)shape;
|
||||
|
||||
Reference in New Issue
Block a user