Posted on 2016-11-08 21:18
點(diǎn)點(diǎn)滴滴 閱讀(445)
評(píng)論(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用于將任意網(wǎng)格轉(zhuǎn)化為一個(gè)或多個(gè)NavMesh。 其所有功能都包含于兩個(gè)目錄: 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命名空間下,與將復(fù)雜的三角形mesh轉(zhuǎn)化為簡(jiǎn)化的多邊形mesh有關(guān)。你可以通過(guò)代碼徹底重新規(guī)劃生成過(guò)程(1),不過(guò)這里有很多事情要做,而且你需要了解生成過(guò)程中各個(gè)方面的實(shí)現(xiàn)細(xì)節(jié)(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
普通生成流程為了滿足編輯期的需要,被設(shè)計(jì)成可變的、可擴(kuò)展的結(jié)構(gòu)。它已經(jīng)為你處理好了很多細(xì)枝末節(jié)的事情(3)。普通功能位于以下的命名空間中:
通用擴(kuò)展(3): nmbuild
Unity擴(kuò)展: 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.
普通生成流程有如下三個(gè)主要步驟,稍后的章節(jié)會(huì)對(duì)這三個(gè)步驟進(jìn)行詳細(xì)的介紹。
編譯數(shù)據(jù)源.
調(diào)用NMGen的生成功能(生成多邊形網(wǎng)格).
生成 Navigation Mesh.(導(dǎo)航網(wǎng)格)
Note Note:
CAINav uses the OpenGL coordinate system.
注意:
CAINav使用OpenGL坐標(biāo)系統(tǒng).(XYZ,左右手什么的);
(1)生成過(guò)程有哪些?
(2)哪些方面的細(xì)節(jié)需要了解?
(3)相對(duì)于recast的擴(kuò)展,cai是基于recast的功能基礎(chǔ)而實(shí)現(xiàn)的;
快速掃盲
1、A* Path Finding是一個(gè)圖最短路徑搜索算法,只要數(shù)據(jù)源支持"遍歷鄰居"的操作,就可以應(yīng)用A*;
2、Ploygen Mesh 是凸多邊形網(wǎng)格,因?yàn)橥苟噙呅蝺?nèi)任意兩點(diǎn)可以直達(dá)--在滿足指定的傾斜角(slope limit)和高度差(step height)的情況下。
3、如果有地形的Triangle Mesh,其實(shí)已經(jīng)可以基于它進(jìn)行A*了,因?yàn)槿切我彩峭苟噙呅巍4筚M(fèi)周章的使用Nav Mesh是為了1、大幅簡(jiǎn)化圖的復(fù)雜度,將不必要的信息進(jìn)行合并。2、記錄一些額外的信息,比如 xxx xxx。