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

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>
            欧美成人精品一区二区| 欧美日韩一区三区四区| 美女主播精品视频一二三四| 欧美一区二区三区免费大片| 亚洲午夜电影在线观看| 亚洲免费网站| 午夜综合激情| 欧美 日韩 国产 一区| 欧美大色视频| 欧美激情一区二区三区成人 | 国模套图日韩精品一区二区| 国产欧美日本| 亚洲成色www8888| 99视频在线精品国自产拍免费观看| 亚洲国产视频a| 亚洲午夜在线| 羞羞答答国产精品www一本| 免费久久99精品国产| 日韩一级黄色av| 新狼窝色av性久久久久久| 久久永久免费| 欧美网站大全在线观看| 1024成人| 午夜精品久久久久99热蜜桃导演| 久久夜色精品一区| 一区二区三区毛片| 免费一区二区三区| 国产偷国产偷亚洲高清97cao | 欧美一区免费| 亚洲大胆女人| 亚洲视频欧洲视频| 免费日韩一区二区| 国产精品自拍一区| 亚洲欧洲精品一区二区三区不卡| 中文在线资源观看网站视频免费不卡 | 久久亚洲春色中文字幕| 欧美视频一区二区三区| 精品成人国产在线观看男人呻吟| 国产精品女主播| 欧美激情久久久久久| 一区二区三区精品| 免费在线一区二区| 国产在线拍揄自揄视频不卡99| 日韩午夜在线观看视频| 久久久免费精品视频| 一区二区三区精品久久久| 免费h精品视频在线播放| 国产色爱av资源综合区| 亚洲桃色在线一区| 免费亚洲视频| 久久精品日产第一区二区三区| 国产精品色婷婷| 亚洲欧美日韩网| 99视频在线精品国自产拍免费观看 | 亚洲精品麻豆| 久久久国产精品一区二区中文| 一本色道久久加勒比88综合| 欧美国产高潮xxxx1819| 亚洲福利小视频| 免费视频一区二区三区在线观看| 欧美在线啊v一区| 国产亚洲精品美女| 欧美主播一区二区三区| 亚洲欧美日韩一区二区| 国产精品一二三四区| 欧美一区二区三区精品| 亚洲欧美日韩国产成人精品影院| 欧美四级剧情无删版影片| 中文在线资源观看网站视频免费不卡 | 国产精品成人午夜| 亚洲午夜激情免费视频| 91久久嫩草影院一区二区| 老牛嫩草一区二区三区日本| 亚洲激情电影在线| 亚洲精品亚洲人成人网| 欧美三级网页| 欧美伊人久久大香线蕉综合69| 午夜精品www| 在线观看亚洲精品视频| 欧美国产精品v| 欧美日韩国产精品一卡| 亚洲视频免费| 亚洲一区国产| 国产日韩亚洲欧美精品| 美日韩精品视频| 牛牛国产精品| 亚洲激情在线观看| 国产精品高潮呻吟久久av无限| 午夜精品婷婷| 久久久久国产精品一区二区| 91久久精品日日躁夜夜躁国产| 亚洲人成高清| 国产精品久久久久永久免费观看| 久久久久久久波多野高潮日日| 久久久综合网| 宅男精品导航| 久久久精品国产免大香伊| 亚洲精品乱码视频| 亚洲免费在线观看| 亚洲激情视频| 午夜宅男欧美| 国产精品99久久久久久白浆小说| 亚洲欧美在线免费观看| 亚洲国产欧美一区二区三区同亚洲 | 久久久噜噜噜久久久| 夜夜躁日日躁狠狠久久88av| 亚洲在线成人精品| 亚洲日本成人网| 欧美在线不卡视频| 亚洲欧美久久久| 欧美久久久久| 免费看精品久久片| 国产日韩一区二区三区在线播放| 亚洲国产人成综合网站| 国产一二精品视频| 一区二区欧美在线| 99国内精品久久| 免费毛片一区二区三区久久久| 欧美在线免费观看视频| 欧美激情1区| 欧美国产精品久久| 亚洲二区在线观看| 欧美一区二区在线看| 午夜精品婷婷| 国产精品美女久久久久久2018| 亚洲国产精品久久人人爱蜜臀| 国产亚洲aⅴaaaaaa毛片| 99国产精品久久久| 999在线观看精品免费不卡网站| 久久黄金**| 久久夜色精品国产欧美乱极品| 国产欧美一区二区精品性| 亚洲视频在线观看视频| 亚洲一二三区在线| 欧美三级日本三级少妇99| 91久久午夜| 亚洲网站啪啪| 国产精品极品美女粉嫩高清在线 | 国产精品露脸自拍| 一区二区三区久久久| 99精品国产在热久久婷婷| 欧美国产日产韩国视频| 鲁鲁狠狠狠7777一区二区| 亚洲精品黄网在线观看| 久久riav二区三区| 美女图片一区二区| 亚洲国产精品va在线看黑人| 久久综合伊人77777尤物| 免费人成精品欧美精品| 亚洲精美视频| 欧美激情aaaa| 在线一区视频| 欧美一区二区女人| 在线成人亚洲| 欧美成人性网| 夜夜爽99久久国产综合精品女不卡| 亚洲天堂av在线免费| 国产精品嫩草99av在线| 欧美在线视频一区二区三区| 久久久亚洲国产天美传媒修理工| 国产一区二区三区精品欧美日韩一区二区三区 | 国产一区二区| 久久精品视频网| 亚洲国产裸拍裸体视频在线观看乱了中文| 一区二区三区在线观看国产| 麻豆精品91| 一本色道久久综合精品竹菊| 久久人人爽人人| 夜夜嗨一区二区| 国产视频欧美| 欧美成人在线网站| 亚洲欧美一区二区原创| 女同一区二区| 亚洲女女女同性video| 国产一区二区三区的电影 | 日韩亚洲国产精品| 国产精品都在这里| 久热这里只精品99re8久| 一二三四社区欧美黄| 久久婷婷丁香| 亚洲手机在线| 亚洲成人自拍视频| 国产精品a久久久久久| 久久av一区| 日韩视频―中文字幕| 久久一区二区三区超碰国产精品| 亚洲人成在线播放网站岛国| 国产精品久久久久久久久久免费| 久久免费高清视频| 亚洲女人天堂成人av在线| 亚洲国产aⅴ天堂久久| 久久精品视频一| 亚洲欧美日韩在线播放| 亚洲精品欧美极品| 在线免费不卡视频| 国产亚洲一区二区三区| 国产精品日日做人人爱| 欧美日韩中文字幕精品| 农村妇女精品| 久久免费黄色|