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

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>
            久久久蜜桃一区二区人| 欧美在线三级| 国产日韩欧美在线播放不卡| 国产精品三上| 国产日韩欧美91| 在线看片成人| 99精品国产福利在线观看免费 | 国产亚洲欧美aaaa| 国产综合精品| 亚洲精品1区| 午夜在线精品偷拍| 欧美激情国产精品| 99re66热这里只有精品3直播| 一区二区三区四区国产精品| 久久电影一区| 欧美激情综合色| 国产亚洲精品v| 一级日韩一区在线观看| 欧美一区在线直播| 91久久嫩草影院一区二区| 一本久道久久久| 欧美在线观看视频在线 | 99亚洲一区二区| 欧美制服丝袜第一页| 欧美理论电影网| 伊人精品成人久久综合软件| 正在播放日韩| 欧美国产日本在线| 午夜天堂精品久久久久| 欧美精品videossex性护士| 国产美女精品一区二区三区| 亚洲精品网站在线播放gif| 久久久99爱| 亚洲视频综合| 欧美日韩成人综合| 亚洲国产日韩欧美在线99| 性感少妇一区| 99精品欧美一区| 欧美激情第4页| 亚洲国产成人91精品| 久久精品国产亚洲a| 99精品热6080yy久久| 欧美bbbxxxxx| 在线观看欧美| 久久综合久久综合九色| 亚洲欧美制服中文字幕| 欧美日韩一区自拍| 99国产一区| 亚洲人成毛片在线播放女女| 久久裸体视频| ●精品国产综合乱码久久久久| 久久成人精品视频| 亚洲欧美国产日韩天堂区| 国产精品爱久久久久久久| 中国女人久久久| 中文精品99久久国产香蕉| 欧美精品乱人伦久久久久久 | 久久久91精品国产| 国产一区久久久| 国产精品久久久久久久电影| 欧美日韩国产91| 亚洲精品影视| 亚洲欧洲精品一区二区| 欧美成人高清视频| 亚洲美女毛片| 国产欧美一区二区精品秋霞影院| 国产精品少妇自拍| 午夜精品亚洲| 亚洲免费在线观看| 国产欧美一区二区精品仙草咪 | 国内精品美女av在线播放| 久久精品视频免费| 久久久久国色av免费看影院 | 亚洲一区二区三区在线播放| 欧美日韩精品欧美日韩精品一| 国产小视频国产精品| 欧美一区亚洲二区| 久久日韩精品| 一本高清dvd不卡在线观看| 一本久道久久久| 国产情人节一区| 欧美激情偷拍| 国产精品mv在线观看| 久久久噜久噜久久综合| 麻豆av一区二区三区| 正在播放亚洲一区| 午夜一区二区三区不卡视频| 尤物99国产成人精品视频| 亚洲国产日韩欧美在线99| 欧美日韩中文字幕日韩欧美| 久久精品盗摄| 欧美片第一页| 久久精品三级| 最新日韩av| 亚洲天堂免费观看| 一区二区三区黄色| 日韩午夜激情av| 韩国成人精品a∨在线观看| 欧美成人免费在线视频| 一区二区三区福利| 亚洲日韩中文字幕在线播放| 久久精品国产一区二区三区| 夜久久久久久| 亚洲高清网站| 在线免费观看视频一区| 国产麻豆9l精品三级站| 国产精品久99| 国产精品一区三区| 国产精品久久久久av| 欧美激情视频一区二区三区不卡| 欧美激情亚洲国产| 久久美女性网| 久久国产成人| 一区二区高清视频在线观看| 亚洲人被黑人高潮完整版| 欧美成人小视频| 欧美日韩免费在线观看| 巨乳诱惑日韩免费av| 国产精品免费看| 亚洲精选久久| 亚洲精品欧美日韩专区| 久久超碰97中文字幕| 午夜欧美精品久久久久久久| 欧美激情一区二区在线| 欧美**字幕| 激情综合在线| 久久精品91久久香蕉加勒比 | 国产一区二区成人| 午夜一级久久| 欧美亚洲日本国产| 一区二区自拍| 久久久精品2019中文字幕神马| 亚洲欧美99| 欧美日韩日韩| 最新成人av在线| 亚洲精品欧美一区二区三区| 裸体素人女欧美日韩| 久久婷婷成人综合色| 欧美视频一区二区三区四区| 亚洲国产高潮在线观看| 亚洲欧洲精品一区二区三区波多野1战4| 久久久久久91香蕉国产| 另类亚洲自拍| 最新中文字幕一区二区三区| 欧美wwwwww| 亚洲国产黄色片| 99精品视频免费在线观看| 欧美日本不卡高清| 一本一本久久a久久精品牛牛影视| 亚洲一二三四区| 国产欧美日韩三区| 欧美一进一出视频| 欧美成人69| 亚洲天堂成人| 国语精品中文字幕| 欧美国产日韩亚洲一区| 一区二区激情视频| 久久久精品视频成人| 在线观看亚洲专区| 欧美日韩精品福利| 午夜视频精品| 亚洲国产视频一区二区| 亚洲一区视频在线| 狠狠色综合播放一区二区| 欧美成人一区二区三区片免费| 亚洲三级视频| 久久久噜噜噜久久中文字幕色伊伊| 亚洲夫妻自拍| 国产精品女同互慰在线看| 久久精品一区中文字幕| 亚洲精品欧美日韩| 久久久蜜臀国产一区二区| 日韩视频在线观看国产| 国产女优一区| 欧美区一区二区三区| 欧美在线一区二区| 一本色道久久综合| 欧美国产先锋| 中文日韩在线| 欧美大尺度在线观看| 在线亚洲免费| 欧美国产精品日韩| 香蕉久久国产| 一区二区三区四区蜜桃| 精品av久久707| 国产精品久久毛片a| 噜噜噜躁狠狠躁狠狠精品视频| 99pao成人国产永久免费视频| 麻豆精品在线视频| 亚洲一区二区毛片| 亚洲激情校园春色| 国产在线欧美日韩| 国产精品欧美一区喷水| 欧美精品在线视频| 久久在精品线影院精品国产| 午夜视频久久久| 亚洲新中文字幕| 9l国产精品久久久久麻豆| 亚洲经典自拍| 亚洲大胆人体视频|