Bullet RigidBodyControl wait until movement is done

Hello, I wonder what is best solution for this.

I have a RigidBodyControl on a person model and I want to make command move from x1=(0,0,0) to x2=(1,0,0) position. I can applyImpulse() to so that the model is moving to the position. But how can I know that the model is done moving to the position?

Is there a listener that says that the body is not moving anymore?

Or do I need to check the physical position of the body and if position=x2 then done?

There is a getLinearVelocity method for finding the current velocity of the object and getAngularVelocity method for finding the amount of current rotation. These are both available on the RigidBodyControl.

getLinearVelocity if I recall returns a direction multiplied by a distance per physics tick in world units. getAngularVelocity returns how much the object is rotating in radians per physics tick.

I’m sure the javadoc will be of help.

There’s no listener specifically for positions. Test the position after each physics tick, using a PhysicsTickListener. And don’t use == on vectors or floats!