posts - 311, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理
The Path Corridor
翻译:kun 2014.12.4

The path corridor provides a way of moving along a navigation path without worrying about the minutiae of managing the path.

Core Class: PathCorridor

In the simplest scenario, a path is a list of waypoints from a starting point to an end point. The waypoints form a connected set of line segments along which a navigation client moves. But 

navigation is much more complex in the real world. There are locomotion limitations, local steering restrictions, dynamic obstacle avoidance, and good old floating point errors. All of these 

issues can make management of a path difficult.


Navigation based on a polygon mesh provides a different abstraction than just a list of waypoints. The path returned by the NavmeshQuery class is a list of polygons. Technically, a client can 

move freely anywhere within this corridor of polygons. If a client strays outside the corridor, then the corridor can be patched up using local searches rather than full path replanning.


The path corridor is loaded with a path, a start point, and a target point. It is then used to move the navigation client through the corridor. It handles path straightening, constraining the 

client to the navigation mesh, and adjusting the corridor due to inaccurate client locomotion.

The PathCorridor API is well documented. The only thing worth repeating here is a warning: You can't just initialize a corridor with a path and forget long distance path planning. Since the 

path corridor class uses local searches to maintain the corridor, attempting to apply large delta movement to the corridor's position or target can result in a malformed corridor. Details are 

in the API documentation.
PathCorridor API已经有详细的文档说明了。在这里只有一点值得提一下:你不能只创建一个廊道然后一切都交给它去做,而不进行长路径规划。虽然廊道使用了局部搜索来维持廊道完整性,不过如果在廊道里产生一