I found a solution. I did not went through all the source but having some previous experience with Physicsjs integrators (https://coderwall.com/p/ntb6bg/metres-seconds-and-newtons-in-physicsjs) I started thinking they might be the root of my problem.
So, apparently a verlet integrator is the default for Physicsjs simulations. I have used it before and it is great. But the verlet integrator uses previous position to calculate next position (no just position, it is a little more complicated than that), so changing it manually screw things up. THAT I do not know how to "fix", or if it is even possible. But there is another way.
In my case what I have is a plain newtonian simulation without fancy stuff or crazy values (I am using the technical terms here...) so an euler integrator worked just fine and as it does not uses previous position to calculate the next it is perfect to "teletransport" my objects without losing velocity, direction etc.
Just remember to load the integrator:
void function (define) {
'use strict';
define(
[
'physicsjs',
'physicsjs/behaviors/attractor',
'physicsjs/behaviors/body-collision-detection',
'physicsjs/behaviors/sweep-prune',
'physicsjs/bodies/circle',
'physicsjs/integrators/improved-euler'
],
physicsModule
);
//
function physicsModule(physics) {
return physics;
}
}(define);
And remember to add the integrator to the simulation:
void function (define) {
'use strict';
define(
[
'physics'
],
simulationModule
);
//
function simulationModule(physics) {
var simulation = physics();
simulation.add(physics.behavior('body-collision-detection'));
simulation.add(physics.behavior('sweep-prune'));
simulation.add(physics.integrator('improved-euler'));
return simulation;
}
}(define);