How to know whether your b2Body is moving or not in Box2D ?

By | June 18, 2011

Hi,

Some times while game building via Box2D Physics Engine, you may need to find out whether your bodies (from b2Body) are moving or not. Use the following sample of code to find out whether the given b2Body is moving or not.


b2Body *urBody;

if(urBody->IsAwake()
{
        //urBbody is moving! It's not in rest!
}

else
{
        //urBody is at rest!
}

🙂

One thought on “How to know whether your b2Body is moving or not in Box2D ?

Leave a Reply

Your email address will not be published. Required fields are marked *