Pretty simple question: will the result of b2Body::GetLinearVelocity tell me if an object is in motion? I would expect that it would - does it?
GetLinearVelocity() returns a b2Vec2. You could use b2Vec2::Length() to find the magnitude of the velocity; if it is zero, the object is not moving.
It would tell you if the body is moving. However it could also happen to be spinning in one place around the origin and getLinearVelocity() would return zero. So if you want to be definitely sure that no motion is happening you should check getAngularVelocity() as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With