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

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(標志位)可以用來控制一個節點的可行走屬性。舉個例子,一個作為'門'的多邊形,在門關閉的時候,可以給這個多邊形設置一個特殊的標志位,以表示它是不可通過的。或者設置一個特殊的標志位,只允許特定類型的角色通過。
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>
            欧美极品色图| 欧美 日韩 国产 一区| 欧美香蕉视频| 亚洲永久精品国产| 亚洲欧美另类国产| 国产伦精品一区二区三区照片91| 亚洲欧美日韩一区二区| 亚洲一区制服诱惑| 国产一区视频网站| 欧美国产日韩xxxxx| 欧美成年人视频网站欧美| aa日韩免费精品视频一| 一区二区三区四区五区在线| 国产精品一区二区三区久久久| 久久av免费一区| 麻豆av一区二区三区| 一本一本久久a久久精品综合麻豆| 日韩一级精品视频在线观看| 国产精品一区一区| 蜜桃久久av一区| 欧美日韩视频不卡| 久久综合伊人77777麻豆| 欧美福利网址| 久久成人精品一区二区三区| 午夜激情亚洲| 久久久久成人精品| 宅男噜噜噜66国产日韩在线观看| 亚洲欧美日韩一区二区在线| 亚洲精品欧洲精品| 亚洲永久网站| 亚洲欧洲偷拍精品| 欧美一区二区视频在线观看2020| 亚洲免费电影在线| 欧美一二区视频| 一区二区毛片| 久久久久欧美精品| 亚洲欧美三级伦理| 噜噜噜在线观看免费视频日韩| 亚洲欧美日韩网| 欧美精品偷拍| 蜜桃精品一区二区三区| 国产精品久久7| 欧美黄色aaaa| 精久久久久久| 亚洲欧美一区二区三区久久| 一区二区精品国产| 噜噜爱69成人精品| 久久一区中文字幕| 国产精品三级久久久久久电影| 亚洲激情在线视频| 国内一区二区三区| 亚洲在线第一页| 亚洲在线网站| 欧美日韩一区二区视频在线观看 | 亚洲第一视频| 亚洲综合色网站| 亚洲天堂av在线免费| 女女同性精品视频| 欧美成人r级一区二区三区| 国产亚洲午夜高清国产拍精品| 亚洲一区区二区| 欧美一区二区| 国产精品盗摄久久久| 一本一本a久久| 亚洲视频网在线直播| 欧美日韩国产影院| 99re亚洲国产精品| 亚洲一区二区免费在线| 欧美日韩视频第一区| 夜夜嗨av一区二区三区免费区| 一区二区三区四区五区视频 | 欧美成人免费在线观看| 免费视频一区| 亚洲激情电影在线| 欧美激情一区三区| 日韩午夜黄色| 午夜精品国产更新| 国产午夜精品理论片a级大结局| 亚洲欧美日韩精品| 老司机午夜精品| 亚洲区一区二| 欧美色中文字幕| 欧美一区二区三区四区视频| 久久久国产午夜精品| 影音先锋欧美精品| 欧美高清在线精品一区| 在线亚洲国产精品网站| 久久久久久亚洲精品杨幂换脸| 影音先锋欧美精品| 狼人天天伊人久久| 亚洲人成亚洲人成在线观看图片| 欧美久色视频| 午夜视频在线观看一区二区| 麻豆av一区二区三区| 亚洲免费成人av| 国产精品自拍网站| 免费不卡视频| 亚洲一区二区三区四区在线观看 | 欧美高清一区二区| 亚洲深爱激情| 激情欧美丁香| 欧美日韩一区二区三区在线观看免 | 亚洲激情在线观看视频免费| 欧美视频一区| 久久资源av| 亚洲一级在线观看| 美女日韩欧美| 亚洲女性裸体视频| 亚洲激情在线视频| 国产精品视频网站| 欧美高清在线播放| 欧美一区二区精品在线| 亚洲免费观看高清在线观看| 久久精品最新地址| 亚洲一区不卡| 亚洲乱码一区二区| 亚洲福利一区| 国产一区二区三区高清播放| 欧美日韩一区二区在线| 久久一区二区三区国产精品| 亚洲免费在线电影| av成人免费在线观看| 欧美电影免费观看网站| 久久精品毛片| 亚洲欧美日韩在线高清直播| 亚洲人成网在线播放| 极品中文字幕一区| 国产日韩综合一区二区性色av| 欧美日韩亚洲一区三区| 欧美激情成人在线视频| 免费成人在线视频网站| 久久精品水蜜桃av综合天堂| 西西人体一区二区| 亚洲欧美成人一区二区在线电影| 亚洲美女在线看| 亚洲精品乱码久久久久久久久 | 亚洲欧美日韩专区| 一区二区三区色| 99精品欧美| 一本色道久久综合亚洲二区三区| 亚洲人体大胆视频| 亚洲欧洲日本一区二区三区| 亚洲第一区在线观看| 在线成人欧美| 亚洲高清不卡| 亚洲精品中文字| 亚洲美女中出| 亚洲一区激情| 午夜在线a亚洲v天堂网2018| 性久久久久久久| 久久久国产精品一区二区中文| 久久福利一区| 久久躁狠狠躁夜夜爽| 你懂的视频一区二区| 久久亚洲色图| 亚洲动漫精品| 日韩视频永久免费观看| 中国女人久久久| 欧美在线播放视频| 久久久www成人免费精品| 乱码第一页成人| 欧美日韩不卡视频| 国产精品久久久久久亚洲毛片| 国产精品久久久久久久9999| 国产日韩欧美亚洲一区| 在线精品国精品国产尤物884a| 亚洲国产精品电影在线观看| 一区二区三区免费看| 午夜伦欧美伦电影理论片| 久久蜜桃资源一区二区老牛| 欧美黄色免费| 亚洲夜间福利| 久久躁狠狠躁夜夜爽| 欧美日本视频在线| 国产欧美亚洲一区| 亚洲丁香婷深爱综合| 亚洲一区日韩| 毛片一区二区三区| 亚洲精品综合在线| 性欧美超级视频| 欧美夫妇交换俱乐部在线观看| 国产精品美女久久久免费| 永久91嫩草亚洲精品人人| 一区二区三区视频在线| 久久香蕉国产线看观看av| 亚洲欧洲精品成人久久奇米网| 亚洲欧美另类久久久精品2019| 玖玖玖国产精品| 国产精品网红福利| 亚洲精品小视频| 久久久久成人精品| 99pao成人国产永久免费视频| 久久av资源网| 国产精品视频久久一区| 亚洲精品久久嫩草网站秘色| 久久九九免费视频| 亚洲在线视频网站| 欧美另类专区| 亚洲人成网站精品片在线观看| 午夜在线视频观看日韩17c|