Added CircleShape:get/setPoint.

This commit is contained in:
Alex Szpakowski
2014-01-03 14:06:23 -04:00
parent b091746118
commit 1d3f6e967d
4 changed files with 47 additions and 2 deletions
+13
View File
@@ -53,6 +53,19 @@ void CircleShape::setRadius(float r)
shape->m_radius = Physics::scaleDown(r);
}
void CircleShape::getPoint(float &x_o, float &y_o) const
{
b2CircleShape *c = (b2CircleShape *) shape;
x_o = Physics::scaleUp(c->m_p.x);
y_o = Physics::scaleUp(c->m_p.y);
}
void CircleShape::setPoint(float x, float y)
{
b2CircleShape *c = (b2CircleShape *) shape;
c->m_p = Physics::scaleDown(b2Vec2(x, y));
}
} // box2d
} // physics
} // love