青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 311, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理
The Navigation Mesh
翻譯:kun 2014.12.4 


The navigation mesh is the primary data model for the navigation system. The only user component that deals directly with the mesh on a regular basis is the component that is 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.
NavigationMesh是導航系統的主要數據模型。用戶只需要創建導航網格數據和維護數據狀態。需要使用導航的地方一般是進行尋路操作,偶爾也可以使用navmesh進行一些交互。


Core Class: Navmesh
核心類:Navmesh


The Data Model
數據模型


Tiles
At the core of the navigation mesh is the tile. Tiles hold the vast majority of structural and state information. In fact, the Navmesh class is little more than a tile manager. It may consist of a single tile, or many tiles laid out in a grid that can be swapped in and out at runtime.
The tile based structure of the navigation mesh adds a lot of flexibility. As mentioned, tiles can be swapped in and out at runtime. This means that the mesh can represent a large area, but not all tiles have to be loaded and active, reducing the mesh's memory footprint. This also allows for a situation where individual tiles can be rebuilt without the need to rebuild the entire mesh.


Tiles(片區)
Navmesh的核心概念之一就是Tile。Tiles存放了大多數的結構信息和狀態信息。事實上,Navmesh類有點像一個TileManager。Navmesh可以由單個Tile構成,也可以向網格一樣的平鋪開來,以便在運行期動態的替換其中的某個Tile。


Structural Elements
The tile's structural data is what defines the navigation graph used for pathfinding. It consists of two types of elements: Polygons and off-mesh connections.
The core of the structure is a mesh of convex polygons with between three and MaxAllowedVertsPerPoly vertices. This mesh is in the same format as NMGen's PolyMesh structure, and usually represents an abstraction of a scene's static geometry.
Off-mesh connections are optional. They consist of two connected endpoints, at least one of which resides within a polygon in the polygon mesh. Off-mesh connections are added to the navigation graph as a single edge and represent special travel routes not defined by scene geometry. Think: The route an agent travels if it jumps over a railing that normally blocks movement.


節點元素
Tile的數據結構是一個用于尋路的graph(圖)。它由兩種數據結構組成:Polygons(多邊形集合)和off-mesh connections(分離的網格之間的連接關系集合)。
Off-mesh connections(分離的網格之間的連接關系集合)可以沒有。它由兩個相互連接的端點構成,至少一邊在某個多邊形里。Off-mesh connections作為單獨的邊添加到圖的數據結構里。它代表著一種特殊的行走路線,并且不是由原始場景的幾何體生成的。想象一下,一個角色跳過一個欄桿-欄桿可以阻礙普通的前進。


State Data
Tiles also contain state data. This data is associated with individual polygons and off-mesh connections. State data includes area and flags.
Areas are used to associate traversal cost to structural elements. This effects pathfinding. For example, the area representing swampland can have a higher cost than the area representing smooth surfaces such as meadowland.
Flags can be used to control when a structural element is traversable. For example, a flag can be set on the polygon below a door to indicate that it is closed and locked. Or a flag can indicate that only agents of a particular type are allowed to traverse the element.
It is important to note that areas and flags have no meaning within the navigation mesh itself. The interpretation of the values is dependant on the NavmeshQueryFilter used by each navigation client. For example: One filter may define a cost of 10 for area id 5, while another may define a cost of 2 for the same area. One flag may be set when a door is closed with one filter checking for the flag during pathfinding, while another filter, used by a ghost, ignores the flag completely.


狀態
Tile包括了一些狀態信息。狀態用來區分不同的Polygons和off-mesh connections。狀態數據包括areas(區域信息)和flags(標志位)。
Areas(區域)一般用來定義移動代價的。代價影響尋路。舉個例子,穿越被標記為沼澤的區域時的代價花費可能比穿越標記為草地的區域的代價要高。
Flags(標志位)可以用來控制一個節點的可行走屬性。舉個例子,一個作為'門'的多邊形,在門關閉的時候,可以給這個多邊形設置一個特殊的標志位,以表示它是不可通過的?;蛘咴O置一個特殊的標志位,只允許特定類型的角色通過。
Areas和Flags的意義不是由Navmesh定義的,這非常重要。這些特別指定的數字都是由導航系認的用戶系統自定義的NavmeshQueryFilter來解釋的。舉個例子:一個過濾器認為ID為5的區域具有10點路徑代價,而另一個過濾器則認為只有2的路徑代價。當一個關閉的門的標志位被設置后(1),一種過濾器在尋路的時候就會考慮這種情況而將這個門視為不可通過,另外一種過濾器-可能是用于鬼魂的尋路-就會完全忽略這個標志位而將此節點認為是可通過的。


Structure Versus State
Why is it important to know the difference between structural elements and state data?
The first reason is that it is possible to save and load state separately from structure. One common use case is to have a serialized version of the full navigation mesh that represents its default state. Then serialized versions of various states, such as the last runtime state, are used to overwrite the default state as needed.
The main limitation is that a state is only valid for a particular structure. So you can't, for example, save the state, change the tile structure, then load the original state into the new structure.
The second reason for understanding the difference between structure and state has to to with tile and polygon references...


結構VS狀態
節點元素和狀態之間進行了分離,理解這點非常重要。
首先,這樣它們可以獨立的進行保存和加載。一個通常的情況是,加載一個預制的Navmesh數據后,其中的狀態可能都是默認值,而利用一個上一次運行時保存的串行化的狀態緩存,可以覆蓋原始的狀態信息。
不過這里有一個限制,狀態信息和節點自身是精確匹配的。你不能在更改完一個節點的信息后,又將一個老的狀態賦給它。
第二點則是對Tile和Polygon的引用方式。


Tile and Polygon References
The last bit of information needed to understand the navigation mesh is the concept of tile and polygon references. These values are one of the few data types that are defined by the navigation mesh rather than the tiles within the mesh. It is important to understand what references are because they are used by various classes to automatically invalidate pathfinding data if the structure of a navigation mesh changes.
Essentially, tile and polygon references are unsigned integer 'handles' to structural elements within a navigation mesh. Tile references are rarely used by navigation clients, while polygon references are all over the place. Polygon references are unique for the navigation mesh, so they are useful for easily identifying a polygon without needing to know which tile it belongs to. 
Despite the name, polygon references can refer to a either a polygon or an off-mesh connection.
References can become invalid. If they are used after they are invalidated, then methods will return a failure status. Polygon references are based on the tile reference. So they will be invalidated whenever their associated tile reference is invalidated.
Structural changes govern the life of a reference. Changing the configuration of a navigation mesh or the internal structure of a tile will invalidate all associated references.
References are preserved during tile state changes such as changes flags and areas. They are also preserved during normal runtime loading and unloading of tiles, and during normal serialization/de-serialization of a navigation mesh.




Tile和Polygon的引用方式
要完全理解Navmesh,最后一點信息是關于Tile和Polygon的引用這個概念。這些引用是Navmesh為數不多的數據結構之一,而不是由Tile定義的。理解引用是什么很重要,因為通過它可以實現當導航網格發生變化的時候,一些類似尋路功能的模塊能自動的將引用的多邊形置為無效。
本質上來說,Tile和Polygon的引用是一個uint32(無符號整型)。Tile的引用很少被客戶代碼直接使用,因為使用場合基本上都可以被Polygon代替。Navmesh里的每個Polygon的引用都是唯一的,因此它們能夠非常方便的定位到指定的Polygon,而不需要知道這個Polygon屬于哪個Tile。
雖然名字差別比較大,Polygon的引用概念同時也涵蓋了off-mesh connections對象。
引用可以變成無效的。如果在無效之后還使用引用,函數會返回一個失敗信息。Polygon的引用有效性是基于Tile的引用的。因此當Tile的引用無效了,所有屬于Tile的Polygon的引用也會無效。
構造的變化會影響引用的生命周期。改變Navmesh的配置或者Tile的內部結構會引起相關的引用全部失效。
引用會在Tile的狀態發生變化的時候進行保存,比如指定Area或Flag值的時候。在運行期動態的加載或卸載Tile也會使引用自動保存,還有當正常串行化/反串行化一個Navmesh的時候。


Creating a Navigation Mesh


There are various pipelines for creating a navigation mesh. If you are using Unity, the Unity extensions make it easier. Otherwise, the basic steps are as follows:
Generate packed tile data:
Generate PolyMesh and PolyMeshDetail data using NMGen.
Optionally create a ConnectionSet. (Off-mesh connections.)
Load the data into a NavmeshTileBuildData object.
Create a NavmeshTileData object from the build data.


The tile's structure and default state is now locked into a packed data format that is ready to be loaded into a navigation mesh.


創建一個Navigation Mesh
創建一個Navmesh有一些流程。如果你在使用Unity,那么CAI提供的Unity擴展會讓這件事情稍微簡單點。否則,基本流程如下:
生成打包好的Tile數據.
使用NMGen生成PolyMesh和PolyMeshDetail。
創建個ConnectionSet(Off-mesh connections的容器),這是可選的。
將這些數據(tile,PolyMesh,PolyMeshDetail,ConnectionSet)加載到NavmeshTileBuildData對象里。
創建一個NavmeshTileDatad數據。


現在Tile的構成關系和默認狀態已經都封裝到NavmeshTileData里了,并且為生成Navmesh而做了數據結構的改變。


Note Note:
Using the NavmeshTileBuildData class directly can be a bit daunting. The GetBuildData(BuildContext, Int32, Int32, PolyMeshData, PolyMeshDetailData, ConnectionSet, Boolean) utility method provides a standard way of 
creating the build data.


注意:
直接使用NavmeshTileBuildData類可能有點難搞。GetBuildData這個工具函數提供了一種標準流程。


Create a navigation mesh:
Single tile navigation meshes are created using the the single step Create(NavmeshTileBuildData, Navmesh) method.
Multi-tile navigation meshes are created then loaded using multiple methods. Use the Create(NavmeshParams, Navmesh) method to initialize an empty mesh. then add tile data using the AddTile(NavmeshTileData, UInt32, UInt32) method.


創建一個Navmesh
如果創建只有個Tile的Navmesh,只需要調用一次Create(【NavmeshTileBuildData】, Navmesh)函數。
創建多Tile的Navmesh需要多次調用函數。使用Create(【NavmeshParams】, Navmesh)函數創建一個空的navmesh,然后使用AddTile函數將Tile添加進去(1)。


Navigation Mesh Serialization


The Navmesh class supports byte serialization using the GetSerializedMesh() method. This saves the entire mesh.
It is possible to serialize state separately from structure on a tile-by-tile basis. Get the tile from the mesh using the GetTile(Int32) method, then use the GetState(Byte[]) and SetState(Byte[]) methods.


Navmesh的串行化
Namvesh類支持二進制串行化,使用GetSerializedMesh來完成。這會將整個mesh轉成二進制數據。
它可以每Tile的、狀態和拓撲結構分離的進行串行化。從mesh里取Tile使用GetTile(Int32)函數,然后使用GetState(Byte[])函數和SetState(Byte[])函數進行狀態的賦值。


(1)Tile數據有自己的生成流程,可以參考An Introduction to NMGen
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久av一区二区| 99热在这里有精品免费| 国产精品区一区| 久久成人综合视频| 亚洲区一区二区三区| 欧美日韩国产成人在线免费| 一本一本久久| 亚洲精品久久久一区二区三区| 欧美一级片久久久久久久 | 99亚洲精品| 9l国产精品久久久久麻豆| 久久精品二区亚洲w码| 欧美在线观看日本一区| 欧美综合二区| 美国十次了思思久久精品导航| 午夜精品久久久久影视| 亚洲午夜成aⅴ人片| 亚洲欧美日韩综合aⅴ视频| 西瓜成人精品人成网站| 久久久亚洲综合| 欧美久久一级| 国内一区二区在线视频观看| 在线看片第一页欧美| 99re6这里只有精品视频在线观看| 在线亚洲+欧美+日本专区| 久久久久国产精品一区| 亚洲电影av在线| 亚洲女爱视频在线| 欧美精品成人| 伊人久久久大香线蕉综合直播| 亚洲精品1区2区| 久久久久久久一区二区三区| 日韩小视频在线观看| 久久九九99视频| 国产欧美va欧美不卡在线| 亚洲色图自拍| 亚洲人成毛片在线播放女女| 欧美一区二区三区啪啪| 国产精品美女xx| 午夜在线一区二区| 亚洲一级在线| 国产精品久久久久久久久| 国产精品99久久久久久久久久久久 | 亚洲欧美国产毛片在线| 欧美jizzhd精品欧美喷水| 依依成人综合视频| 老司机午夜免费精品视频| 欧美一区二区三区精品电影| 欧美激情精品久久久久久变态| 午夜在线不卡| 亚洲第一二三四五区| 老司机免费视频久久| 亚洲一卡久久| 国产日韩欧美亚洲| 男女精品网站| 欧美日韩国产精品一卡| 欧美jizzhd精品欧美巨大免费| 欧美日韩在线精品一区二区三区| 亚洲人成网站在线播| 亚洲国产精品一区二区第四页av | 久久精品二区三区| 免费视频亚洲| 久久久国产一区二区三区| 麻豆免费精品视频| 欧美一区二区免费观在线| 欧美成人免费在线视频| 亚洲欧美日韩一区二区三区在线观看 | 亚洲裸体视频| 午夜视频在线观看一区| 亚洲精品专区| 久久精品国产第一区二区三区最新章节 | 欧美午夜免费影院| 你懂的视频一区二区| 国产精品毛片a∨一区二区三区|国| 欧美成人一区二区在线| 国产毛片精品视频| 国产真实久久| 久久精品夜色噜噜亚洲aⅴ| 性久久久久久久久| 国产精品超碰97尤物18| 99国产精品久久久| 99热在这里有精品免费| 久久夜色精品国产欧美乱极品| 久久久www成人免费无遮挡大片 | 久久亚洲精品网站| 久久成人羞羞网站| 国内精品福利| 日韩视频在线你懂得| 欧美电影免费观看高清| 亚洲理伦在线| 欧美一区二区三区四区视频| 国产日韩欧美日韩大片| 老妇喷水一区二区三区| 亚洲人成在线观看网站高清| 亚洲免费婷婷| 亚洲激情网站| 国产精品嫩草久久久久| 另类欧美日韩国产在线| 亚洲精品午夜| 久久综合色播五月| 欧美1区2区| 日韩一级网站| 国产午夜精品久久久久久久| 久久香蕉国产线看观看av| 亚洲人在线视频| 久久综合网色—综合色88| 亚洲制服欧美中文字幕中文字幕| 在线国产精品播放| 国产精品爽爽ⅴa在线观看| 免费视频一区| 久久一区亚洲| 久久免费精品日本久久中文字幕| 在线不卡视频| 国产自产女人91一区在线观看| 欧美视频在线观看免费| 蜜桃精品一区二区三区| 久久精品亚洲精品| 久久成人一区| 久久亚洲精品伦理| 欧美69视频| 欧美日韩福利视频| 欧美日韩国产在线看| 欧美日韩国产黄| 欧美视频国产精品| 国产精品自拍小视频| 国产日产欧产精品推荐色| 国产一区二区三区黄| 一区三区视频| 中文久久精品| 久久精品日韩欧美| 欧美成人国产| 一本久久综合亚洲鲁鲁五月天 | 在线观看一区二区视频| 亚洲黄色在线观看| 亚洲午夜精品一区二区| 久久爱www久久做| 亚洲国内自拍| 久久免费视频在线| 欧美视频精品一区| 亚洲二区在线| 久久久国产成人精品| 亚洲激情在线播放| 久久电影一区| 国产精品久久久久久久7电影| 狠狠色伊人亚洲综合成人| 99ri日韩精品视频| 欧美成熟视频| 久久九九免费| 国产精品影视天天线| 亚洲色在线视频| 亚洲精品视频啊美女在线直播| 欧美一级播放| 国产精品一区二区三区久久| 欧美成人高清视频| 国产欧美亚洲日本| 亚洲综合精品自拍| 亚洲视频一区二区在线观看| 欧美大片18| 亚洲精品乱码久久久久久蜜桃91| 亚洲免费视频在线观看| 狠狠色丁香久久综合频道| 一本色道久久精品| 亚洲九九精品| 欧美香蕉视频| 欧美一区二区视频免费观看| 一本到高清视频免费精品| 欧美日本不卡视频| 亚洲欧美激情四射在线日| 亚洲综合色自拍一区| 国产亚洲精品一区二555| 久久久久久9999| 欧美好吊妞视频| 性欧美超级视频| 欧美xxxx在线观看| 亚洲一二三四久久| 久久久.com| 亚洲影院一区| 欧美成人官网二区| 久久精品国产久精国产思思| 欧美大片在线观看一区| 欧美在线www| 欧美日韩视频在线一区二区| 久久精品国产亚洲一区二区| 欧美国产亚洲视频| 久久免费国产精品1| 国产精品国产三级国产普通话三级| 久久精品视频播放| 国产精品每日更新| 亚洲精品女av网站| 国产欧美日韩精品专区| 一区二区免费在线播放| 亚洲毛片av| 欧美日韩美女在线| 欧美激情四色 | 欧美天天在线| 亚洲国产一成人久久精品| 国内一区二区在线视频观看| 欧美在线观看一区二区| 欧美一级视频| 欧美中文字幕在线播放|