The easiest way is to look at the direction that the gun points when you identify the body, and use GetWorldVector to see how it changes. For example, if a gun points straight up when you create a body, this will be the direction (0,1). Then you can use GetWorldVector at any time to get the current direction of this vector in world coordinates:
body->GetWorldVector( b2Vec2(0,1) );
source share