Development of a Real-Time Hierarchical 3D Path Planning Algorithm for Unmanned Aerial Vehicles