You can iterate over the fixtures in a body like this:
Code:
for (b2Fixture* f = body->GetFixtureList(); f; f = f->GetNext())
{
....
}
Once you have a fixture you will need to check what kind of shape it has, then cast to that shape type to access the shape data:
Code:
b2Shape::Type shapeType = fixture->GetType();
if ( shapeType == b2Shape::e_circle )
{
b2CircleShape* circleShape = (b2CircleShape*)fixture->GetShape();
...
}
else if ( shapeType == b2Shape::e_polygon )
{
b2PolygonShape* polygonShape = (b2PolygonShape*)fixture->GetShape();
....
}
For polygon shapes you can use GetVertexCount() and GetVertex() to get the vertices.
For loop shapes, GetCount() and GetVertices().
For edge shapes, m_vertex1 and m_vertex2.
Remember to transform these by the body's transform to get them in world coords.