You could step the physics forward many times, without rendering any of it. Do it enough times to cover the amount of time needed for your physics to rest. This is easier than checking velocities.
You'd do that by advancing the skeleton time with Skeleton update
, then call updateWorldTransform(Physics.update)
to apply physics and update the bone transforms, which are needed for the next physics update. Repeat until you're sure the physics has settled.
If you move your skeleton a large distance, it will likely cause physics to sproooing. You can reset physics so this doesn't happen. You could also reset physics and reset the skeleton to the setup pose (or an animation pose) then step it many times as I described. By starting at a known pose, you can be more sure about how long you need to step the physics.
Stepping the physics like this is common. It is needed if you want to start showing an animation or pose and don't want to see the physics transition from the setup or old pose.
I expect you can step many times (eg likely 3000+ steps) before performance is an issue. Spine does similar stepping every frame, from frame zero to the current frame, for the Deterministic
physics setting.
It's quite easy to do with the existing API. A method to "update until rest" (or "is resting") is tricky, because some physics setups will never come to a rest, or the rest values could vary compared to other setups.