Q E WASD point with mouse
when you go in a portal the game converts your x and y velocity into a direction and magnitude, then it sends you to the other portal and rotates that direction according to the difference of your direction to the enter portal and the exit portal. then it converts the new direction and magnitude back to x and y velocities. this doesn't work all the time as sometimes the player hits the floor before portal and the velocity isn't carried over but this is only when in very long falls.