[#538] calculate residual velocity instead of nullifying it

this fixes movements/walking on slopes (or non rectangular shapes)