Posted on 2016-11-08 21:13
點(diǎn)點(diǎn)滴滴 閱讀(2633)
評(píng)論(0) 編輯 收藏 引用 所屬分類:
19 源碼收集
An Introduction to Navigation
翻譯:kun 2014.12.4
The navigation side of CAINav consists of features used to create and use navigation meshes for pathfinding and local steering.
CAINav提供創(chuàng)建Navmesh、基于Navmesh的尋路和局部轉(zhuǎn)向避障。
Core: org.critterai.nav
Unity extensions: org.critterai.nav.u3d
核心命名空間:org.critterai.nav
Unity擴(kuò)展:org.critterai.nav.u3d
There are five main classes you'll be dealing with:
經(jīng)常和你打交道的類有五個(gè):
Note Note:
CAINav uses the OpenGL coordinate system.
注意:
CAINav使用OpenGL坐標(biāo)系。
The Navmesh class defines the structure and state of the navigation mesh. The only user component that deals directly with this class on a regular basis is the component responsible for creating the mesh and managing its state. Normal navigation clients, the one's needing to perform pathfinding and such, rarely if ever interact directly with the navigation mesh.
【Navmesh】類定義了導(dǎo)航網(wǎng)格的數(shù)據(jù)結(jié)構(gòu)和狀態(tài)。這個(gè)類用于保存用戶創(chuàng)建的導(dǎo)航網(wǎng)格數(shù)據(jù)和數(shù)據(jù)狀態(tài)。需要使用導(dǎo)航的地方一般是進(jìn)行尋路操作,偶爾也可以使用navmesh進(jìn)行一些交互。
The most important class to understand and become comfortable with is the NavmeshQuery class. It provides almost all of the client navigation features, including A* and Dijkstra path searches, string pulling, point and polygon searches, raycasting, etc.
【NavmeshQuery】類是需要理解透徹的最重要的類。它提供了所有用戶級(jí)的導(dǎo)航功能,包括使用A*算法和Dijkstra算法進(jìn)行尋路、繩索牽引、搜索點(diǎn)和多邊形、射線查詢等等。
The NavmeshQueryFilter is a seemingly minor class, but it has a large impact on navigation. Filters are used to define the costs of traversing the mesh and flags that control which parts of the navigation mesh are included in operations. Multiple filters can be used to customize the navigation behavior on a per client basis.
【NavmeshQueryFilter】是一個(gè)看起來很小的類,但是它對(duì)導(dǎo)航的影響很大。過濾器用來定義穿過某個(gè)區(qū)域時(shí)的代價(jià)。可以使用多個(gè)過濾器來實(shí)現(xiàn)自定義的導(dǎo)航行為。
The PathCorridor class provides a way of moving along a navigation path without worrying about the minutiae of managing the path.
【PathCorridor】類提供了一種沿導(dǎo)航路徑,而不必?fù)?dān)心管理路徑的細(xì)節(jié)(1)。
The CrowdManager is the big beast of the navigation classes. It not only handles a lot of the path management for you, but also local steering and dynamic avoidance between navigation clients. I.e. It can keep your agents from running into each other.
【CrowdManager】類是十分龐雜的一個(gè)類。它不僅為你處理了非常多的路徑管理相關(guān)的事情,同時(shí)也處理一些局部避障和避開其它尋路代理對(duì)象。也就是說,他可以讓所有的代理對(duì)象不會(huì)相互穿插。
(1)需要實(shí)驗(yàn)。