added code for applying the trajectory with new IPositionDirect interface