Posted on 2016-11-08 21:18
點點滴滴 閱讀(464)
評論(0) 編輯 收藏 引用 所屬分類:
19 源碼收集
The purpose of NMGen is to generate navigation meshes from arbitrary source geometry. Features fall into two categories: Core and 'standard build'.
NMGen用于將任意網格轉化為一個或多個NavMesh。 其所有功能都包含于兩個目錄: Core(核心) 和 'standard build'(普通);
The core features are located in the org.critterai.nmgen namespace and involve creating simplified polygon mesh data from detailed triangle-based source geometry. You can code your own build process from scratch using these features, but it will require a significant amount of work and detailed knowlege of all aspects of the process.
核心功能位于nmgen命名空間下,與將復雜的三角形mesh轉化為簡化的多邊形mesh有關。你可以通過代碼徹底重新規劃生成過程(1),不過這里有很多事情要做,而且你需要了解生成過程中各個方面的實現細節(2)。
The standard build process implements a flexible, extendable build process suitable for use at design time. It takes care of many of the mundane details for you. Its features are implemented in the following namespaces:
Common extentions: org.critterai.nmbuild
Unity extensions: org.critterai.nmbuild.u3d.editor
普通生成流程為了滿足編輯期的需要,被設計成可變的、可擴展的結構。它已經為你處理好了很多細枝末節的事情(3)。普通功能位于以下的命名空間中:
通用擴展(3): nmbuild
Unity擴展: nmbuild.u3d.editor
The standard build process has three main steps which will be covered in detail throughout the rest of this section.
Compile the input.
The NMGen Build. (Produces the polygon meshes.)
Create the navigation mesh.
普通生成流程有如下三個主要步驟,稍后的章節會對這三個步驟進行詳細的介紹。
編譯數據源.
調用NMGen的生成功能(生成多邊形網格).
生成 Navigation Mesh.(導航網格)
Note Note:
CAINav uses the OpenGL coordinate system.
注意:
CAINav使用OpenGL坐標系統.(XYZ,左右手什么的);
(1)生成過程有哪些?
(2)哪些方面的細節需要了解?
(3)相對于recast的擴展,cai是基于recast的功能基礎而實現的;
快速掃盲
1、A* Path Finding是一個圖最短路徑搜索算法,只要數據源支持"遍歷鄰居"的操作,就可以應用A*;
2、Ploygen Mesh 是凸多邊形網格,因為凸多邊形內任意兩點可以直達--在滿足指定的傾斜角(slope limit)和高度差(step height)的情況下。
3、如果有地形的Triangle Mesh,其實已經可以基于它進行A*了,因為三角形也是凸多邊形。大費周章的使用Nav Mesh是為了1、大幅簡化圖的復雜度,將不必要的信息進行合并。2、記錄一些額外的信息,比如 xxx xxx。