SetLinearVelocity in objects local coordinates

Hello.

Is there any easy way of applying SetLinearVelocity but in objects space?

For example I want to SetLinearVelocity so that body "drives" forward (in body reference) all the time. But hitting some object changes body rotation and is should also change direction of movement in world reference.

I hope you know what I mean.

Best regards,
Maciej K.
You can use these functions to convert between local and global directions:

b2Body::GetLocalVector( b2Vec2 worldVector )
b2Body::GetWorldVector( b2Vec2 localVector )
irresistible force wrote:
You can use these functions to convert between local and global directions:

b2Body::GetLocalVector( b2Vec2 worldVector )
b2Body::GetWorldVector( b2Vec2 localVector )


Great.
That is what I was looking for.

Original thread: https://box2d.org/forum/viewtopic.php?t=9675