Starting box2d update

This commit is contained in:
Garrett Brown
2020-08-16 06:34:37 -04:00
parent 365387150e
commit 74c6021e8d
153 changed files with 9634 additions and 8518 deletions
+10 -22
View File
@@ -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