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
+8 -22
View File
@@ -48,28 +48,21 @@ void EdgeShape::setNextVertex(float x, float y)
b2EdgeShape *e = (b2EdgeShape *)shape;
b2Vec2 v(x, y);
e->m_vertex3 = Physics::scaleDown(v);
e->m_hasVertex3 = true;
}
void EdgeShape::setNextVertex()
{
b2EdgeShape *e = (b2EdgeShape *)shape;
e->m_hasVertex3 = false;
}
bool EdgeShape::getNextVertex(float &x, float &y) const
{
b2EdgeShape *e = (b2EdgeShape *)shape;
if (e->m_hasVertex3)
{
b2Vec2 v = Physics::scaleUp(e->m_vertex3);
x = v.x;
y = v.y;
return true;
}
return false;
b2Vec2 v = Physics::scaleUp(e->m_vertex3);
x = v.x;
y = v.y;
return true;
}
void EdgeShape::setPreviousVertex(float x, float y)
@@ -77,28 +70,21 @@ void EdgeShape::setPreviousVertex(float x, float y)
b2EdgeShape *e = (b2EdgeShape *)shape;
b2Vec2 v(x, y);
e->m_vertex0 = Physics::scaleDown(v);
e->m_hasVertex0 = true;
}
void EdgeShape::setPreviousVertex()
{
b2EdgeShape *e = (b2EdgeShape *)shape;
e->m_hasVertex0 = false;
}
bool EdgeShape::getPreviousVertex(float &x, float &y) const
{
b2EdgeShape *e = (b2EdgeShape *)shape;
if (e->m_hasVertex0)
{
b2Vec2 v = Physics::scaleUp(e->m_vertex0);
x = v.x;
y = v.y;
return true;
}
return false;
b2Vec2 v = Physics::scaleUp(e->m_vertex0);
x = v.x;
y = v.y;
return true;
}
int EdgeShape::getPoints(lua_State *L)