mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Starting box2d update
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user