The easiest way is to look at the direction the object βcollidesβ when you define the body, and use GetWorldVector to see how it changes. For example, if it is facing 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 to apply force:
b2Vec2 forceDirection = body->GetWorldVector( b2Vec2(0,1) );
source share