Posted on 2016-11-08 21:16
點(diǎn)點(diǎn)滴滴 閱讀(453)
評(píng)論(0) 編輯 收藏 引用 所屬分類(lèi):
19 源碼收集
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.
廊道提供了一種沿指定導(dǎo)航路徑進(jìn)行移動(dòng),而不必?fù)?dān)心管理使用路徑數(shù)據(jù)時(shí)的細(xì)節(jié)問(wèn)題。
Core Class: PathCorridor
核心類(lèi):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.
在最簡(jiǎn)單的情景里,一個(gè)路徑是一組從開(kāi)始點(diǎn)到結(jié)束點(diǎn)的路點(diǎn)列表。如果能精確的按照使用此導(dǎo)航數(shù)據(jù)運(yùn)動(dòng),角色的軌跡會(huì)是一組相互連接的線(xiàn)段。但是在真實(shí)環(huán)境下進(jìn)行導(dǎo)航比這個(gè)要復(fù)雜的多。你需要考慮角色的運(yùn)
動(dòng)能力的局限性(1)、局部轉(zhuǎn)向限制、避開(kāi)動(dòng)態(tài)障礙物、以及一些常見(jiàn)的浮點(diǎn)數(shù)錯(cuò)誤。所有這些情況都會(huì)讓管理一個(gè)路徑的使用變得困難。
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.
在一個(gè)多邊形網(wǎng)格上進(jìn)行導(dǎo)航比在一堆路點(diǎn)上進(jìn)行導(dǎo)航要更加抽象一些。NavmeshQuery返回的Path是一組多邊形。技術(shù)上講,一個(gè)角色可以在這個(gè)廊道上的任意多邊形內(nèi)自由的移動(dòng)。如果一個(gè)角色跑出了這個(gè)廊道的范
圍,廊道的范圍可以使用局部搜索進(jìn)行擴(kuò)大,而不是重新規(guī)劃整條路徑。
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.
廊道需要加載一個(gè)Path、一個(gè)起始點(diǎn)、一個(gè)目標(biāo)點(diǎn)。然后用于角色在這個(gè)廊道內(nèi)移動(dòng)。它處理路徑的矯正、確保角色不會(huì)跑出Navmesh、以及當(dāng)角色移動(dòng)超出預(yù)期時(shí)修正廊道信息。
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已經(jīng)有詳細(xì)的文檔說(shuō)明了。在這里只有一點(diǎn)值得提一下:你不能只創(chuàng)建一個(gè)廊道然后一切都交給它去做,而不進(jìn)行長(zhǎng)路徑規(guī)劃。雖然廊道使用了局部搜索來(lái)維持廊道完整性,不過(guò)如果在廊道里產(chǎn)生一
個(gè)大的運(yùn)動(dòng)距離,或者目標(biāo)點(diǎn)離得很遠(yuǎn),會(huì)產(chǎn)生一個(gè)畸形的廊道(1)。更多的細(xì)節(jié)可以參考相關(guān)API文檔。
(1)加速、減速、慣性之類(lèi)的運(yùn)動(dòng)參數(shù).
(2)啥意思?