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

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>
            欧美+日本+国产+在线a∨观看| 99精品国产福利在线观看免费 | 亚洲高清一二三区| 欧美国产精品劲爆| 欧美成人精品三级在线观看| 在线成人激情视频| 亚洲大黄网站| 欧美日韩国产在线看| 亚洲一级黄色av| 午夜伦理片一区| 国产视频欧美视频| 另类人畜视频在线| 欧美区日韩区| 午夜在线电影亚洲一区| 久久成人国产精品| 亚洲美女精品久久| 亚洲一区二区精品| 永久久久久久| 日韩亚洲国产精品| 国产在线播放一区二区三区| 亚洲国产精品一区二区www| 欧美日韩精品欧美日韩精品一 | 国产欧美成人| 亚洲国产精品专区久久| 亚洲精品女av网站| 国产精品免费网站在线观看| 免费日本视频一区| 欧美亚洲成人免费| 欧美激情第五页| 国产精品久久国产愉拍| 美女久久一区| 国产精品午夜视频| 亚洲激情视频网| 国产一区久久久| 欧美视频一区二区三区…| 午夜影院日韩| 欧美精品免费播放| 美女性感视频久久久| 国产精品视频yy9299一区| 欧美韩日一区| 狠狠色综合网站久久久久久久| 日韩视频不卡中文| 亚洲精品一区二区三区四区高清| 香蕉成人啪国产精品视频综合网| 亚洲精品国产日韩| 久久精品首页| 欧美专区日韩视频| 国产精品久久久久久亚洲调教| 欧美韩日一区二区三区| 国产一区二区三区丝袜| 一本色道久久加勒比精品| 亚洲精品黄色| 免费在线一区二区| 欧美1区2区| 在线国产亚洲欧美| 久久久久女教师免费一区| 久久精品国产清高在天天线| 国产精品黄色| 宅男66日本亚洲欧美视频| 一区二区三区蜜桃网| 欧美女同视频| 亚洲视屏一区| 国产精品视频一二三| 在线午夜精品| 小嫩嫩精品导航| 国产欧美精品一区二区三区介绍| 亚洲小说区图片区| 欧美亚洲视频在线看网址| 国产精品免费小视频| 午夜久久资源| 美乳少妇欧美精品| 最新国产成人在线观看| 欧美黄污视频| 国产精品99久久不卡二区| 亚洲尤物影院| 国产亚洲va综合人人澡精品| 久久se精品一区二区| 欧美不卡激情三级在线观看| 91久久久久久国产精品| 欧美人与性动交cc0o| 夜夜夜久久久| 久久国产一二区| 在线精品观看| 欧美日韩另类国产亚洲欧美一级| 一区二区毛片| 久久综合伊人77777麻豆| 亚洲国产成人精品视频| 欧美激情影院| 亚洲性人人天天夜夜摸| 久久久久久成人| 亚洲精品国产精品国自产在线 | 欧美激情自拍| 一本色道久久综合狠狠躁的推荐| 性做久久久久久免费观看欧美| 国产一区二区三区的电影| 一区二区三区www| 国产精品成人在线观看| 久久国产欧美精品| 亚洲精品国产精品久久清纯直播| 欧美一区二区视频免费观看| 在线观看日韩av| 欧美性猛交xxxx乱大交蜜桃| 久久国产一区| 一本色道久久88综合日韩精品| 久久九九国产精品怡红院| 99精品视频网| 激情欧美一区二区三区在线观看| 欧美女人交a| 久热精品视频在线观看| 亚洲综合不卡| 亚洲精品黄色| 免费成人av在线| 午夜精品一区二区三区在线播放 | 国产午夜精品理论片a级大结局| 欧美a级一区| 久久成人精品电影| 亚洲一区二区三区精品在线观看 | 久久久久国产精品麻豆ai换脸| 一区二区黄色| 亚洲国产成人av| 国产精品一区二区男女羞羞无遮挡 | 亚洲美女在线观看| 欧美高清影院| 免费欧美高清视频| 欧美在线黄色| 欧美一区二区三区视频| 一区二区三区欧美成人| 亚洲精品资源| 亚洲精品视频在线| 亚洲成色www久久网站| 国产原创一区二区| 国产日韩欧美在线看| 国产精品s色| 国产精品伦一区| 国产精品成人久久久久| 欧美日韩精品一区二区| 欧美激情综合五月色丁香小说| 久久婷婷国产综合尤物精品| 欧美一区二区在线免费观看| 亚洲男人天堂2024| 亚洲无毛电影| 亚洲综合999| 欧美一区二区三区四区在线观看地址| 亚洲免费一在线| 欧美一级片久久久久久久| 午夜精品久久久久久久男人的天堂 | 国产主播一区二区三区四区| 国产精品一卡二| 国产日韩欧美高清| 国产日韩欧美在线播放不卡| 国产喷白浆一区二区三区| 国产婷婷97碰碰久久人人蜜臀| 国产精品一区一区三区| 国产日韩在线不卡| 亚洲精品国产精品国自产在线| 亚洲精品中文字| 中文久久精品| 欧美一区二区三区四区视频 | 香蕉成人久久| 久色婷婷小香蕉久久| 欧美久久久久免费| 国产精品99免视看9| 国产日韩一区二区三区在线| 国外成人在线视频| 亚洲国产精品999| 99精品视频免费| 欧美在线一区二区| 欧美黑人在线观看| 亚洲视频精选在线| 久久精品国产亚洲a| 欧美片网站免费| 国产亚洲欧洲| 一区二区三欧美| 久久久亚洲一区| 亚洲乱码国产乱码精品精可以看| 亚洲欧美日韩国产一区二区三区 | 欧美日韩一区综合| 国内精品视频一区| 亚洲最快最全在线视频| 久久精品国产免费观看| 91久久在线观看| 亚洲欧洲一级| 久久精品国产亚洲一区二区| 欧美日韩色一区| 在线免费观看日本一区| 亚洲一区二区在线观看视频| 久热精品在线| 久久久久久久久久久成人| 亚洲视频一二| 国产一区三区三区| 国产欧美日韩精品专区| 国产精品久久久久久久久久久久久| 亚洲久久成人| 欧美在线视频在线播放完整版免费观看 | 亚洲午夜未删减在线观看| 欧美一站二站| 欧美日韩国产首页| 亚洲电影免费观看高清完整版在线观看| 99国产精品自拍| 美女91精品|