Direct Method for Gliding Trajectory Optimization Problem