Automatic obstacle avoidance is a key feature of future UAVs expected to execute low altitude missions in urban areas or in the mission theater not fully surveyed, thereby still attracting many research interests. As an approach of autonomous obstacle avoidance that can provide the three dimensional obstacle field navigation capability in partially or fully unknown environment for rotary-wing UAVs, this paper describes a novel integrated framework based on the receding horizon trajectory optimization combined with global path search method. The obstacle avoidance is formulated as the finite horizon nonlinear trajectory optimization problem having approximated dynamics and maneuverability limits of the vehicle as constraints, and the finite horizon is tied to the obstacle detection sensor range capability. The trajectory optimization is solved in real-time with the spline based direct method, Nonlinear Trajectory Generator (NTG). A shortest global path search algorithm in conjunction with any prior information of the terrain is used to obtain the initial guess of solution needed for the NTG, and the NTG algorithm in conjunction with the current measurements of the terrain are used to arrive at a local optimal path, while accounting for vehicle and terrain constraints. The developed Integrated Optimal Obstacle Avoidance (INTOPTOA) algorithms were implemented in the Georgia Tech Unmanned Aerial Vehicle Simulation Tool (GUST) and on the onboard computer of the Georgia Tech UAV test bed. Both simulation and flight test evaluations of the developed algorithms were carried out for benchmark cases from the literature. In addition, the developed algorithms were further evaluated through flight tests for obstacle field navigation with a LIDAR obstacle detection system. Results obtained thus far demonstrate the viability of the developed algorithms for arriving at safe and optimal trajectories for a UAV flying through an obstacle field.