Number of rotation

How can i know the number of rotation of the body?

And i want to know whether it is rotating in clockwise or anticlockwise.
archuganesh wrote:
How can i know the number of rotation of the body?

And i want to know whether it is rotating in clockwise or anticlockwise.



body->GetAngle()/PI*180;
//will give you degrees of rotation

If you want to check direction of rotation you can probably GetAngularVelocity, clockwise should be positive and anti negative.
ekdev wrote:
archuganesh wrote:
How can i know the number of rotation of the body?

And i want to know whether it is rotating in clockwise or anticlockwise.



body->GetAngle()/PI*180;
//will give you degrees of rotation

If you want to check direction of rotation you can probably GetAngularVelocity, clockwise should be positive and anti negative.



thanks for your reply.

I want to know the object is rotating fully from 0 to 360 and 360 to 0 continuously.

example;

the bike is rotation as back flip or front flip. And whether it is rotating fully.

how to find out this?

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