To avoid this jump in position when the point we track passes through the portal, we can just change the reference point as it passes through. Now the position and speed are continuous, and physics still works!