Posted on 2016-11-08 21:13
點點滴滴 閱讀(2653)
評論(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提供創建Navmesh、基于Navmesh的尋路和局部轉向避障。
Core: org.critterai.nav
Unity extensions: org.critterai.nav.u3d
核心命名空間:org.critterai.nav
Unity擴展:org.critterai.nav.u3d
There are five main classes you'll be dealing with:
經常和你打交道的類有五個:
Note Note:
CAINav uses the OpenGL coordinate system.
注意:
CAINav使用OpenGL坐標系。
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】類定義了導航網格的數據結構和狀態。這個類用于保存用戶創建的導航網格數據和數據狀態。需要使用導航的地方一般是進行尋路操作,偶爾也可以使用navmesh進行一些交互。
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】類是需要理解透徹的最重要的類。它提供了所有用戶級的導航功能,包括使用A*算法和Dijkstra算法進行尋路、繩索牽引、搜索點和多邊形、射線查詢等等。
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】是一個看起來很小的類,但是它對導航的影響很大。過濾器用來定義穿過某個區域時的代價??梢允褂枚鄠€過濾器來實現自定義的導航行為。
The PathCorridor class provides a way of moving along a navigation path without worrying about the minutiae of managing the path.
【PathCorridor】類提供了一種沿導航路徑,而不必擔心管理路徑的細節(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】類是十分龐雜的一個類。它不僅為你處理了非常多的路徑管理相關的事情,同時也處理一些局部避障和避開其它尋路代理對象。也就是說,他可以讓所有的代理對象不會相互穿插。
(1)需要實驗。