I’m writing a LibGDX game where I want two objects to have the exact same movement, but still interact with the physics environment normally. The best way to do this that I can think of is to average the change in their velocities after Box2D does a velocity iteration, but before it solves for position (I’ve tried a few things, this seems like the most robust).
Calling world.step(1 / 60f, 6, 2) does 6 velocity iterations and 2 position iterations before I can get in there and change stuff. I know I could make a callback function for after each contact is resolved, but I don’t want to adjust anything until the entire velocity iteration is complete.
Is there a way to run code after each velocity iteration within a single physics step?