Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current moving speed of the box2d object

I apply force to the b2body, but would like to know is there a way to know what speed the b2body is after applyforce/applylinearimpulse?

b2Body* car;
b2Vec2 force = b2Vec2(0,100);
car->ApplyForce(force, car->GetPosition());
like image 270
TonyTakeshi Avatar asked Nov 26 '25 06:11

TonyTakeshi


1 Answers

b2Vec2 vel = body->GetLinearVelocity();

like image 135
renevdkooi Avatar answered Nov 27 '25 23:11

renevdkooi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!