I want to copy all Box2D-related data (position, velocity, rotation, impulse, ...) from one body to another.
This is what I've got working (with box2djsweb):
var t = body.GetTransform();
other_body.SetTransform(t);
var vel = body.GetLinearVelocity();
other_body.SetLinearVelocity(vel);
I think that covers most things, but judging by the behaviour, I've missed something. It's as if it's a frame or tick behind. Also, this isn't placing the other_body
in the exact location as the the original body.
Is there a better way to do this?