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

posts - 311, comments - 0, trackbacks - 0, articles - 0
  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

翻譯:kun 2014.12.4

The navigation mesh query is the most important class to understand since most navigation clients will interact with the query rather than the navigation mesh itself. The mesh contains the data, but the query provides almost all of the features necessary for pathfinding.
用戶和navigation mesh query(Navmesh查詢器)打交道的次數比Navmes本身多的多。網格包含數據,但是查詢器提供了幾乎全部的尋路特性。



Core Class: NavmeshQuery
核心類:NavmeshQuery


Query features fall into two general categories: Pathfinding and local search.
查詢器的特性包括兩個大的方面:尋路和局部搜索。


Pathfinding involves standard A* and Dijkstra searches that find the best path(s) between two points. Paths are made up of a list polygon references that represent a polygon corridor from the start to the end position. Path straightening is used to convert the path into a list of waypoints. (I.e. String pulling.)
尋路使用標準的A*和Dijkstra算法,用于找出兩點之間最好的路徑(可能不止一條)。Path(路徑)是由一組Polygon的引用(1)組成數據,從開始點到結束點。路徑矯正是將一個Path數據轉為一組路點數據(即String pulling(繩子拉直))(2)。


The local search features offer various methods for locating polygons and points on polygons, and for querying the local environment. I.e. Raycasting, finding the distance to the nearest wall, etc.
局部搜索功能提供多種方式進行多邊形和多邊形上的點的定位,以及查詢局部的一些環境信息。比如射線查詢、計算離最近的墻的距離之類的。


Many of the query methods require a NavmeshQueryFilter. Filters define area traversal costs as well as flags used for including/excluding polygons and off-mesh connections from results.
許多查詢方法要求一個NavmeshQueryFilter(查詢過濾器)。過濾器定義了Polygon和off-mesh connections的穿越代價,代價值可以參與啟發式的計算,用來決定是否在最終路徑里包含/排除某個Polygon或off-mesh connections。


The best way to understand the query class is to play around with it. The Sample Pack includes the Query Explorer demo that permits experimentation with all of the main query features.
理解查詢器的最好辦法就是用一用。【Sample Pack(示例包)】里的【Query Explorer(查詢演示)】demo展示了查詢器一些主要的特性。


Common Operations
通用操作


This section contains some simple examples of common query operations.
Finding a Point in the Navigation Mesh
You can't do much without first getting a valid point on the navigation mesh. So the first step is to find one.
GetNearestPoint(Vector3, Vector3, NavmeshQueryFilter, NavmeshPoint)
本節是例子
查詢一個在Navmesh上的點
如果你沒有一個Navmesh上的起始點的話,你能做的不多。所以第一部就是找一個點。
GetNearestPoint(Vector3, Vector3, NavmeshQueryFilter, NavmeshPoint)函數提供此功能。


CopyC#
// Where 'query' is a NavmeshQuery object and 'filter' is a NavmeshQueryFilter object.
// 'position' is a Vector3 indicating the world position of the client.
// 'query'是一個 NavmeshQuery對象,'filter'是一個NavmeshQueryFilter對象。
// 'position' 是一個Vector3對象,值為角色的世界坐標。


NavmeshPoint result;
Vector3 extents = new Vector3(1, 1, 1);  // Keep this to the minimum extents practical. // 范圍越小越好。


NavStatus status = query.GetNearestPoly(position, extents, filter
        , out result);


if (result.polyRef == Navmesh.NullPoly)
{
        // Handle error.  Could not find a result.
        // The status can be checked to see if there was an error.  If not, then
        // the cause is that the search extents did not overlap any polygons.
        // 錯誤處理。找不到結果。
        // 可以檢查狀態看看是什么問題。如果沒有問題,說明指定范圍里不包含多邊形。
}


// Use the result point, which includes a vector point and the reference of 
// the polygon that contains the point.
//使用結果點。包括一個Vector3的點和包含這個點的Polygon的引用。


Basic Pathfinding
Even if you are planning to use PathCorridor or CrowdManager, you'll always need to do long distance planning using the basic NavmeshQuery features. First, get a path, then optionally straighten it.
基礎的尋徑
即使你打算使用pathcorridor或crowdmanager,你也會需要NavmeshQuery的功能來完成一些長距離路徑規劃。第一,獲取一條路徑,然后選擇性的弄直它(3)。


CopyC#
// Where 'query' is a NavmeshQuery object and 'filter' is a NavmeshQueryFilter object.
// 'start' and 'end' are NavmeshPoints known to be on the navigation mesh.
// 'query'是一個 NavmeshQuery對象,'filter'是一個NavmeshQueryFilter對象;
// 'start' 和 'end' 是已知的在Navmesh上的點;


int pathCount;
// The path will be a list of polygon references.
// path是一組polygon的引用;
uint[] path = new uint[100];  // Size for maximum allowed path length. // 路徑的最大長度;
NavStatus status;


if (start.polyRef == end.polyRef)
{
        // No need to do any planning.
        // 開始點和結束點在同一個多邊形內,不需要進行路徑規劃;
        pathCount = 1;
        path[0] = start.polyRef;
}
else
{
        status = query.FindPath(start, end, filter, path
                , out pathCount);


        if (NavUtil.Failed(status) || path.pathCount == 0)
        {
                // Handle pathfinding failure.
                // 處理尋路失敗;
        }
        else if (end.polyRef != path[pathCount - 1])
        {
            // Handle a partial path.
            // The query either could not reach the end point,
            // or the path buffer was too small to hold the
            // entire path.  (A check of 'status' will reveal if
            // the buffer was too small.)
            // 處理只有一部分路徑的情況;
            // 可能是結束點不可達;
            // 或者路徑的buffer長度太小,裝不下整條路徑;
            // 如果是buffer太小,可以檢查state;
        }


}


// If you need to straighten the path...
// 如果你需要拉直路徑;


const int MaxStraightPath = 4;  // Just getting the first 4 waypoints. // 只處理前4個路點;
int wpCount;


// The waypoints.
// 路點列表;
Vector3[] wpPoints = new Vecotr3[MaxStraightPath];


// A list of polygon references.  (The polygon being entered at each waypoint.)
// 一個多邊形引用列表;(路點是多邊形的入口點)
uint[] wpPath = new uint[MaxStraightPath];


// The type of each waypoint. (Start, end, off-mesh connection.)
// 每一個路點的類型信息.(開始點,結束點, 連接);
WaypointFlag[] wpFlags = new WaypointFlag[MaxStraightPath];


status = query.GetStraightPath(start.point
        , goal.point
        , path
        , 0                // The index of the start of the path. // 路徑的開始點;
        , pathCount        // The length of the path.             // 路徑的長度;
        , wpPoints
        , wpFlags
        , wpPath
        , out wpCount);


if (NavUtil.Failed(status) || wpCount == 0)
{
        // Handle the failure.  There should always be at least one waypoint 
        // (the goal) for a valid point/path combination,
        // 處理失敗。應該總是存在一個點(目標點)用于路徑合并.
}


// Use the path and waypoints.
// 使用路徑和路點;


(1)可以理解為句柄,或索引。
(2)Path上每個多邊形中心之間的連線一般不會是直線,路徑如果有拐角也會造成一些美觀上的問題,這個時候需要使用特定的方法將路徑變得盡量筆直,就好像將一根繩子拉直。
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            亚洲欧洲综合另类| 国产精品青草综合久久久久99| 国产一区二区三区在线观看免费 | 欧美激情在线播放| 亚洲国产天堂网精品网站| 亚洲福利视频在线| 欧美日本三级| 久久精品理论片| 欧美成人在线免费观看| 亚洲欧美国产精品专区久久| 午夜精品久久一牛影视| 亚洲国产精品久久精品怡红院| 亚洲高清在线观看| 国内精品视频一区| 亚洲美女毛片| 亚洲精品乱码久久久久久久久| 亚洲作爱视频| 亚洲精品一区二区三区在线观看 | 久热成人在线视频| 欧美色综合天天久久综合精品| 久久久久久色| 国产精品一区二区在线观看网站| 欧美成人中文字幕| 国产亚洲综合性久久久影院| 亚洲久久一区二区| 亚洲激情视频在线观看| 久久精品在这里| 西西人体一区二区| 欧美日韩在线直播| 中文一区二区| 亚洲综合国产激情另类一区| 欧美日韩免费在线| 亚洲精品久久| 一区二区三区精品久久久| 亚洲一区二区成人在线观看| 亚洲麻豆视频| 国产精品高清免费在线观看| 亚洲日本理论电影| 亚洲视频一区在线| 欧美亚韩一区| 久久精品欧美日韩| 亚洲大胆人体在线| 亚洲免费电影在线| 国产精品入口日韩视频大尺度| 99成人精品| 玖玖视频精品| 亚洲一区视频在线| 激情亚洲网站| 国产精品国产成人国产三级| 欧美一二三视频| 亚洲国产天堂网精品网站| 一本久久精品一区二区| 国产色综合网| 欧美三级电影大全| 久久久久久免费| 亚洲夜间福利| 亚洲精品美女在线观看| 久久麻豆一区二区| 亚洲一区二区三区在线播放| 在线成人h网| 国产午夜精品美女毛片视频| 欧美精品二区| 欧美成人国产一区二区| 午夜精品一区二区在线观看| 亚洲国产片色| 亚洲精品国偷自产在线99热| 欧美粗暴jizz性欧美20| 欧美影院一区| 久久精品国产综合| 久久久不卡网国产精品一区| 亚欧美中日韩视频| 午夜天堂精品久久久久| 亚洲欧美综合精品久久成人| 一本久道久久综合婷婷鲸鱼| 亚洲美女中文字幕| 亚洲视频在线视频| 亚洲一区日韩在线| 久久激情五月丁香伊人| 久久久精品日韩欧美| 久久只有精品| 亚洲精品在线免费| 久久亚洲综合网| 91久久精品美女高潮| 亚洲国产另类精品专区| 亚洲国内在线| 亚洲欧美日韩一区| 老司机午夜精品视频| 欧美国产亚洲精品久久久8v| 99re6这里只有精品视频在线观看| 亚洲乱码国产乱码精品精天堂| 99国产精品99久久久久久粉嫩| 亚洲欧美一区二区原创| 欧美第一黄色网| 国产精品一区二区女厕厕| 亚洲人成网站在线观看播放| 亚洲永久免费av| 亚洲国产日韩欧美在线图片| 亚洲女女女同性video| 欧美精品一区二区三区蜜桃| 国产一区深夜福利| 性色一区二区| 亚洲美女视频在线免费观看| 羞羞色国产精品| 国产精品国产自产拍高清av王其| 亚洲三级免费| 欧美成人在线免费观看| 欧美在线播放一区| 国产日本欧美一区二区| 欧美亚洲一级| 久久国产精品久久久久久| 欧美视频一区二区三区在线观看 | 美女爽到呻吟久久久久| 午夜影院日韩| 激情小说另类小说亚洲欧美 | 亚洲欧美日韩天堂| 国产精品人人做人人爽人人添| 亚洲综合国产精品| 欧美一区二区免费| 亚洲国产精品一区| 91久久国产综合久久| 国产精品大片wwwwww| 欧美在线你懂的| 欧美a级大片| 欧美一级视频| 欧美激情aⅴ一区二区三区| 在线综合+亚洲+欧美中文字幕| 亚洲视频在线观看网站| 国产一区二区精品久久99| 欧美激情黄色片| 国产日韩欧美不卡| 亚洲国产精品尤物yw在线观看 | 久久久久国产精品一区| 亚洲高清不卡在线观看| 亚洲精品国产视频| 国产视频一区免费看| 亚洲国内欧美| 亚洲高清二区| 久久婷婷国产综合精品青草| 亚洲视频专区在线| 欧美精品日本| 亚洲国产网站| 亚洲精品国产精品国自产在线| 亚洲在线免费| 欧美一区二区三区在线播放| 欧美紧缚bdsm在线视频| 亚洲国产精品成人久久综合一区| 国内精品一区二区三区| 亚洲淫性视频| 久久久青草婷婷精品综合日韩 | 欧美成人亚洲成人| 女人色偷偷aa久久天堂| 亚洲第一区在线观看| 欧美怡红院视频| 蜜桃久久av一区| 亚洲国产小视频在线观看| 免费在线欧美黄色| 999亚洲国产精| 欧美一级大片在线观看| 国语自产在线不卡| 老司机精品福利视频| 亚洲日本在线观看| 亚洲欧美中文另类| 激情欧美国产欧美| 欧美日韩午夜在线视频| 欧美一级片一区| 亚洲国产精品美女| 久久福利资源站| 亚洲欧洲偷拍精品| 国产性做久久久久久| 欧美激情一二三区| 久久精品视频在线| 亚洲午夜免费视频| 欧美激情性爽国产精品17p| 欧美一区二区黄| 日韩一级视频免费观看在线| 国产欧美一区二区在线观看| 欧美成人国产| 麻豆亚洲精品| 久久蜜桃精品| 小处雏高清一区二区三区| 亚洲精品乱码久久久久| 免费亚洲电影| 免费中文日韩| 欧美国产日韩亚洲一区| 久久久人成影片一区二区三区| 午夜久久一区| 亚洲大片精品永久免费| 国产精品视频福利| 国产精品视频第一区| 国产精品久久久久永久免费观看| 欧美精品免费看| 欧美丝袜一区二区| 国产精品久久久久久久9999| 欧美午夜美女看片| 国产欧美日韩在线| 国产视频一区二区在线观看| 激情视频一区| 亚洲午夜精品视频| 欧美在线一二三| 欧美激情视频给我|