mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-08-31 07:28:48 +00:00
954 lines
54 KiB
HTML
954 lines
54 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.9.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Recast Navigation: dtPathCorridor Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
|
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Recast Navigation
|
|
</div>
|
|
<div id="projectbrief">Navigation-mesh Toolset for Games</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.1 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('classdtPathCorridor.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classdtPathCorridor-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">dtPathCorridor Class Reference<div class="ingroups"><a class="el" href="group__crowd.html">Crowd</a> | <a class="el" href="group__detour.html">Detour</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Represents a dynamic polygon corridor used to plan agent movement.
|
|
<a href="classdtPathCorridor.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="DetourPathCorridor_8h_source.html">DetourPathCorridor.h</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a2e7ceb397b60be4ff6e839206e6ef571"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a2e7ceb397b60be4ff6e839206e6ef571">dtPathCorridor</a> ()</td></tr>
|
|
<tr class="separator:a2e7ceb397b60be4ff6e839206e6ef571"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a10dc98697fb9f6e60063ab49a41c391b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a10dc98697fb9f6e60063ab49a41c391b">~dtPathCorridor</a> ()</td></tr>
|
|
<tr class="separator:a10dc98697fb9f6e60063ab49a41c391b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a85b4c98157b68a57b9c3302f45d0ed7f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a85b4c98157b68a57b9c3302f45d0ed7f">init</a> (const int maxPath)</td></tr>
|
|
<tr class="memdesc:a85b4c98157b68a57b9c3302f45d0ed7f"><td class="mdescLeft"> </td><td class="mdescRight">Allocates the corridor's path buffer. <a href="classdtPathCorridor.html#a85b4c98157b68a57b9c3302f45d0ed7f">More...</a><br /></td></tr>
|
|
<tr class="separator:a85b4c98157b68a57b9c3302f45d0ed7f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:abe057e7b5e1d6677e3d9eadb558df2b0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#abe057e7b5e1d6677e3d9eadb558df2b0">reset</a> (<a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> ref, const float *pos)</td></tr>
|
|
<tr class="memdesc:abe057e7b5e1d6677e3d9eadb558df2b0"><td class="mdescLeft"> </td><td class="mdescRight">Resets the path corridor to the specified position. <a href="classdtPathCorridor.html#abe057e7b5e1d6677e3d9eadb558df2b0">More...</a><br /></td></tr>
|
|
<tr class="separator:abe057e7b5e1d6677e3d9eadb558df2b0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa1076957ddf987a274a756fbf8202cab"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#aa1076957ddf987a274a756fbf8202cab">findCorners</a> (float *cornerVerts, unsigned char *cornerFlags, <a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> *cornerPolys, const int maxCorners, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="memdesc:aa1076957ddf987a274a756fbf8202cab"><td class="mdescLeft"> </td><td class="mdescRight">Finds the corners in the corridor from the position toward the target. <a href="classdtPathCorridor.html#aa1076957ddf987a274a756fbf8202cab">More...</a><br /></td></tr>
|
|
<tr class="separator:aa1076957ddf987a274a756fbf8202cab"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3970b6cd229731debe6beb41d9885463"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a3970b6cd229731debe6beb41d9885463">optimizePathVisibility</a> (const float *<a class="el" href="RecastMeshDetail_8cpp.html#af019d68006e1f2d7b24c8f09051424cc">next</a>, const float pathOptimizationRange, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="memdesc:a3970b6cd229731debe6beb41d9885463"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to optimize the path if the specified point is visible from the current position. <a href="classdtPathCorridor.html#a3970b6cd229731debe6beb41d9885463">More...</a><br /></td></tr>
|
|
<tr class="separator:a3970b6cd229731debe6beb41d9885463"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a69288d28ab5d23b2c2654e45c5a33c25"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a69288d28ab5d23b2c2654e45c5a33c25">optimizePathTopology</a> (<a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="memdesc:a69288d28ab5d23b2c2654e45c5a33c25"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to optimize the path using a local area search. <a href="classdtPathCorridor.html#a69288d28ab5d23b2c2654e45c5a33c25">More...</a><br /></td></tr>
|
|
<tr class="separator:a69288d28ab5d23b2c2654e45c5a33c25"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae44344d2404b1d06f74c15f6748ad48d"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#ae44344d2404b1d06f74c15f6748ad48d">moveOverOffmeshConnection</a> (<a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> offMeshConRef, <a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> *refs, float *startPos, float *endPos, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery)</td></tr>
|
|
<tr class="separator:ae44344d2404b1d06f74c15f6748ad48d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae2e11d477d193c79197fa28acae824b8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#ae2e11d477d193c79197fa28acae824b8">fixPathStart</a> (<a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> safeRef, const float *safePos)</td></tr>
|
|
<tr class="separator:ae2e11d477d193c79197fa28acae824b8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5ed6daf1e663f2b0a854794e431514c8"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a5ed6daf1e663f2b0a854794e431514c8">trimInvalidPath</a> (<a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> safeRef, const float *safePos, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="separator:a5ed6daf1e663f2b0a854794e431514c8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aeb23d3697b0e17837b06b13ae5be4e52"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#aeb23d3697b0e17837b06b13ae5be4e52">isValid</a> (const int maxLookAhead, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="memdesc:aeb23d3697b0e17837b06b13ae5be4e52"><td class="mdescLeft"> </td><td class="mdescRight">Checks the current corridor path to see if its polygon references remain valid. <a href="classdtPathCorridor.html#aeb23d3697b0e17837b06b13ae5be4e52">More...</a><br /></td></tr>
|
|
<tr class="separator:aeb23d3697b0e17837b06b13ae5be4e52"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a320a804c422fdb9b58f677b9b42ebf22"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a320a804c422fdb9b58f677b9b42ebf22">movePosition</a> (const float *npos, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="memdesc:a320a804c422fdb9b58f677b9b42ebf22"><td class="mdescLeft"> </td><td class="mdescRight">Moves the position from the current location to the desired location, adjusting the corridor as needed to reflect the change. <a href="classdtPathCorridor.html#a320a804c422fdb9b58f677b9b42ebf22">More...</a><br /></td></tr>
|
|
<tr class="separator:a320a804c422fdb9b58f677b9b42ebf22"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a66f8097a4f49c077b6c6da5c727c6877"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a66f8097a4f49c077b6c6da5c727c6877">moveTargetPosition</a> (const float *npos, <a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> *navquery, const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> *filter)</td></tr>
|
|
<tr class="memdesc:a66f8097a4f49c077b6c6da5c727c6877"><td class="mdescLeft"> </td><td class="mdescRight">Moves the target from the curent location to the desired location, adjusting the corridor as needed to reflect the change. <a href="classdtPathCorridor.html#a66f8097a4f49c077b6c6da5c727c6877">More...</a><br /></td></tr>
|
|
<tr class="separator:a66f8097a4f49c077b6c6da5c727c6877"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af26a1205a7e38f0389a2dcb2dc23ca9b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#af26a1205a7e38f0389a2dcb2dc23ca9b">setCorridor</a> (const float *target, const <a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> *polys, const int npath)</td></tr>
|
|
<tr class="memdesc:af26a1205a7e38f0389a2dcb2dc23ca9b"><td class="mdescLeft"> </td><td class="mdescRight">Loads a new path and target into the corridor. <a href="classdtPathCorridor.html#af26a1205a7e38f0389a2dcb2dc23ca9b">More...</a><br /></td></tr>
|
|
<tr class="separator:af26a1205a7e38f0389a2dcb2dc23ca9b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a607e96864c9cb68386d57e90d8681159"><td class="memItemLeft" align="right" valign="top">const float * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a607e96864c9cb68386d57e90d8681159">getPos</a> () const</td></tr>
|
|
<tr class="memdesc:a607e96864c9cb68386d57e90d8681159"><td class="mdescLeft"> </td><td class="mdescRight">Gets the current position within the corridor. <a href="classdtPathCorridor.html#a607e96864c9cb68386d57e90d8681159">More...</a><br /></td></tr>
|
|
<tr class="separator:a607e96864c9cb68386d57e90d8681159"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa1ea66fedbbab0cabfb279287aee392b"><td class="memItemLeft" align="right" valign="top">const float * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#aa1ea66fedbbab0cabfb279287aee392b">getTarget</a> () const</td></tr>
|
|
<tr class="memdesc:aa1ea66fedbbab0cabfb279287aee392b"><td class="mdescLeft"> </td><td class="mdescRight">Gets the current target within the corridor. <a href="classdtPathCorridor.html#aa1ea66fedbbab0cabfb279287aee392b">More...</a><br /></td></tr>
|
|
<tr class="separator:aa1ea66fedbbab0cabfb279287aee392b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1328df3808790d4bedec54112b0fab43"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a1328df3808790d4bedec54112b0fab43">getFirstPoly</a> () const</td></tr>
|
|
<tr class="memdesc:a1328df3808790d4bedec54112b0fab43"><td class="mdescLeft"> </td><td class="mdescRight">The polygon reference id of the first polygon in the corridor, the polygon containing the position. <a href="classdtPathCorridor.html#a1328df3808790d4bedec54112b0fab43">More...</a><br /></td></tr>
|
|
<tr class="separator:a1328df3808790d4bedec54112b0fab43"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4d23baaf31661832ea81fd5a6fcc0a59"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a4d23baaf31661832ea81fd5a6fcc0a59">getLastPoly</a> () const</td></tr>
|
|
<tr class="memdesc:a4d23baaf31661832ea81fd5a6fcc0a59"><td class="mdescLeft"> </td><td class="mdescRight">The polygon reference id of the last polygon in the corridor, the polygon containing the target. <a href="classdtPathCorridor.html#a4d23baaf31661832ea81fd5a6fcc0a59">More...</a><br /></td></tr>
|
|
<tr class="separator:a4d23baaf31661832ea81fd5a6fcc0a59"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:adc4aee4a1867ce60e6b319edc686661f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#adc4aee4a1867ce60e6b319edc686661f">getPath</a> () const</td></tr>
|
|
<tr class="memdesc:adc4aee4a1867ce60e6b319edc686661f"><td class="mdescLeft"> </td><td class="mdescRight">The corridor's path. <a href="classdtPathCorridor.html#adc4aee4a1867ce60e6b319edc686661f">More...</a><br /></td></tr>
|
|
<tr class="separator:adc4aee4a1867ce60e6b319edc686661f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a16bfdb275fb8f385c269cd06236f8213"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classdtPathCorridor.html#a16bfdb275fb8f385c269cd06236f8213">getPathCount</a> () const</td></tr>
|
|
<tr class="memdesc:a16bfdb275fb8f385c269cd06236f8213"><td class="mdescLeft"> </td><td class="mdescRight">The number of polygons in the current corridor path. <a href="classdtPathCorridor.html#a16bfdb275fb8f385c269cd06236f8213">More...</a><br /></td></tr>
|
|
<tr class="separator:a16bfdb275fb8f385c269cd06236f8213"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
|
<div class="textblock"><p>Represents a dynamic polygon corridor used to plan agent movement. </p>
|
|
<p>,</p>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>The corridor is loaded with a path, usually obtained from a <a class="el" href="classdtNavMeshQuery.html#a9d86502949fcd4f96ffd350d4ef69e3c" title="Finds a path from the start polygon to the end polygon.">dtNavMeshQuery::findPath()</a> query. The corridor is then used to plan local movement, with the corridor automatically updating as needed to deal with inaccurate agent locomotion.</p>
|
|
<p>Example of a common use case:</p>
|
|
<ol type="1">
|
|
<li>Construct the corridor object and call <a class="el" href="classdtPathCorridor.html#a85b4c98157b68a57b9c3302f45d0ed7f" title="Allocates the corridor's path buffer.">init()</a> to allocate its path buffer.</li>
|
|
<li>Obtain a path from a <a class="el" href="classdtNavMeshQuery.html" title="Provides the ability to perform pathfinding related queries against a navigation mesh.">dtNavMeshQuery</a> object.</li>
|
|
<li>Use <a class="el" href="classdtPathCorridor.html#abe057e7b5e1d6677e3d9eadb558df2b0" title="Resets the path corridor to the specified position.">reset()</a> to set the agent's current position. (At the beginning of the path.)</li>
|
|
<li>Use <a class="el" href="classdtPathCorridor.html#af26a1205a7e38f0389a2dcb2dc23ca9b" title="Loads a new path and target into the corridor.">setCorridor()</a> to load the path and target.</li>
|
|
<li>Use <a class="el" href="classdtPathCorridor.html#aa1076957ddf987a274a756fbf8202cab" title="Finds the corners in the corridor from the position toward the target.">findCorners()</a> to plan movement. (This handles dynamic path straightening.)</li>
|
|
<li>Use <a class="el" href="classdtPathCorridor.html#a320a804c422fdb9b58f677b9b42ebf22" title="Moves the position from the current location to the desired location, adjusting the corridor as neede...">movePosition()</a> to feed agent movement back into the corridor. (The corridor will automatically adjust as needed.)</li>
|
|
<li>If the target is moving, use <a class="el" href="classdtPathCorridor.html#a66f8097a4f49c077b6c6da5c727c6877" title="Moves the target from the curent location to the desired location, adjusting the corridor as needed t...">moveTargetPosition()</a> to update the end of the corridor. (The corridor will automatically adjust as needed.)</li>
|
|
<li>Repeat the previous 3 steps to continue to move the agent.</li>
|
|
</ol>
|
|
<p>The corridor position and target are always constrained to the navigation mesh.</p>
|
|
<p>One of the difficulties in maintaining a path is that floating point errors, locomotion inaccuracies, and/or local steering can result in the agent crossing the boundary of the path corridor, temporarily invalidating the path. This class uses local mesh queries to detect and update the corridor as needed to handle these types of issues.</p>
|
|
<p>The fact that local mesh queries are used to move the position and target locations results in two beahviors that need to be considered:</p>
|
|
<p>Every time a move function is used there is a chance that the path will become non-optimial. Basically, the further the target is moved from its original location, and the further the position is moved outside the original corridor, the more likely the path will become non-optimal. This issue can be addressed by periodically running the <a class="el" href="classdtPathCorridor.html#a69288d28ab5d23b2c2654e45c5a33c25" title="Attempts to optimize the path using a local area search.">optimizePathTopology()</a> and <a class="el" href="classdtPathCorridor.html#a3970b6cd229731debe6beb41d9885463" title="Attempts to optimize the path if the specified point is visible from the current position.">optimizePathVisibility()</a> methods.</p>
|
|
<p>All local mesh queries have distance limitations. (Review the <a class="el" href="classdtNavMeshQuery.html" title="Provides the ability to perform pathfinding related queries against a navigation mesh.">dtNavMeshQuery</a> methods for details.) So the most accurate use case is to move the position and target in small increments. If a large increment is used, then the corridor may not be able to accurately find the new location. Because of this limiation, if a position is moved in a large increment, then compare the desired and resulting polygon references. If the two do not match, then path replanning may be needed. E.g. If you move the target, check <a class="el" href="classdtPathCorridor.html#a4d23baaf31661832ea81fd5a6fcc0a59" title="The polygon reference id of the last polygon in the corridor, the polygon containing the target.">getLastPoly()</a> to see if it is the expected polygon. </p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a2e7ceb397b60be4ff6e839206e6ef571"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2e7ceb397b60be4ff6e839206e6ef571">◆ </a></span>dtPathCorridor()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">dtPathCorridor::dtPathCorridor </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a10dc98697fb9f6e60063ab49a41c391b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a10dc98697fb9f6e60063ab49a41c391b">◆ </a></span>~dtPathCorridor()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">dtPathCorridor::~dtPathCorridor </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="aa1076957ddf987a274a756fbf8202cab"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa1076957ddf987a274a756fbf8202cab">◆ </a></span>findCorners()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int dtPathCorridor::findCorners </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>cornerVerts</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned char * </td>
|
|
<td class="paramname"><em>cornerFlags</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> * </td>
|
|
<td class="paramname"><em>cornerPolys</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const int </td>
|
|
<td class="paramname"><em>maxCorners</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Finds the corners in the corridor from the position toward the target. </p>
|
|
<p>(The straightened path.) </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">cornerVerts</td><td>The corner vertices. [(x, y, z) * cornerCount] [Size: <= maxCorners] </td></tr>
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">cornerFlags</td><td>The flag for each corner. [(flag) * cornerCount] [Size: <= maxCorners] </td></tr>
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">cornerPolys</td><td>The polygon reference for each corner. [(polyRef) * cornerCount] [Size: <= <code>maxCorners</code>] </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">maxCorners</td><td>The maximum number of corners the buffers can hold. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">navquery</td><td>The query object used to build the corridor. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>The filter to apply to the operation. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The number of corners returned in the corner buffers. [0 <= value <= <code>maxCorners</code>]</dd></dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>This is the function used to plan local movement within the corridor. One or more corners can be detected in order to plan movement. It performs essentially the same function as <a class="el" href="classdtNavMeshQuery.html#ac160434c85bdf9edec24fa621f120d2d" title="Finds the straight path from the start to the end position within the polygon corridor.">dtNavMeshQuery::findStraightPath</a>.</p>
|
|
<p>Due to internal optimizations, the maximum number of corners returned will be (<code>maxCorners</code> - 1) For example: If the buffers are sized to hold 10 corners, the function will never return more than 9 corners. So if 10 corners are needed, the buffers should be sized for 11 corners.</p>
|
|
<p>If the target is within range, it will be the last corner and have a polygon reference id of zero. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae2e11d477d193c79197fa28acae824b8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae2e11d477d193c79197fa28acae824b8">◆ </a></span>fixPathStart()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::fixPathStart </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> </td>
|
|
<td class="paramname"><em>safeRef</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>safePos</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1328df3808790d4bedec54112b0fab43"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1328df3808790d4bedec54112b0fab43">◆ </a></span>getFirstPoly()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> dtPathCorridor::getFirstPoly </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The polygon reference id of the first polygon in the corridor, the polygon containing the position. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The polygon reference id of the first polygon in the corridor. (Or zero if there is no path.) </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4d23baaf31661832ea81fd5a6fcc0a59"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4d23baaf31661832ea81fd5a6fcc0a59">◆ </a></span>getLastPoly()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> dtPathCorridor::getLastPoly </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The polygon reference id of the last polygon in the corridor, the polygon containing the target. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The polygon reference id of the last polygon in the corridor. (Or zero if there is no path.) </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="adc4aee4a1867ce60e6b319edc686661f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#adc4aee4a1867ce60e6b319edc686661f">◆ </a></span>getPath()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a>* dtPathCorridor::getPath </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The corridor's path. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The corridor's path. [(polyRef) * <a class="el" href="classdtPathCorridor.html#a16bfdb275fb8f385c269cd06236f8213" title="The number of polygons in the current corridor path.">getPathCount()</a>] </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a16bfdb275fb8f385c269cd06236f8213"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a16bfdb275fb8f385c269cd06236f8213">◆ </a></span>getPathCount()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int dtPathCorridor::getPathCount </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>The number of polygons in the current corridor path. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>The number of polygons in the current corridor path. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a607e96864c9cb68386d57e90d8681159"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a607e96864c9cb68386d57e90d8681159">◆ </a></span>getPos()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const float* dtPathCorridor::getPos </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Gets the current position within the corridor. </p>
|
|
<p>(In the first polygon.) </p><dl class="section return"><dt>Returns</dt><dd>The current position within the corridor. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa1ea66fedbbab0cabfb279287aee392b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa1ea66fedbbab0cabfb279287aee392b">◆ </a></span>getTarget()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const float* dtPathCorridor::getTarget </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Gets the current target within the corridor. </p>
|
|
<p>(In the last polygon.) </p><dl class="section return"><dt>Returns</dt><dd>The current target within the corridor. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a85b4c98157b68a57b9c3302f45d0ed7f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a85b4c98157b68a57b9c3302f45d0ed7f">◆ </a></span>init()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::init </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const int </td>
|
|
<td class="paramname"><em>maxPath</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Allocates the corridor's path buffer. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">maxPath</td><td>The maximum path size the corridor can handle. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if the initialization succeeded.</dd></dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<dl class="section warning"><dt>Warning</dt><dd>Cannot be called more than once. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aeb23d3697b0e17837b06b13ae5be4e52"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aeb23d3697b0e17837b06b13ae5be4e52">◆ </a></span>isValid()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::isValid </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const int </td>
|
|
<td class="paramname"><em>maxLookAhead</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Checks the current corridor path to see if its polygon references remain valid. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">maxLookAhead</td><td>The number of polygons from the beginning of the corridor to search. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">navquery</td><td>The query object used to build the corridor. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>The filter to apply to the operation. <br />
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>The path can be invalidated if there are structural changes to the underlying navigation mesh, or the state of a polygon within the path changes resulting in it being filtered out. (E.g. An exclusion or inclusion flag changes.) </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae44344d2404b1d06f74c15f6748ad48d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae44344d2404b1d06f74c15f6748ad48d">◆ </a></span>moveOverOffmeshConnection()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::moveOverOffmeshConnection </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> </td>
|
|
<td class="paramname"><em>offMeshConRef</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> * </td>
|
|
<td class="paramname"><em>refs</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>startPos</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float * </td>
|
|
<td class="paramname"><em>endPos</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a320a804c422fdb9b58f677b9b42ebf22"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a320a804c422fdb9b58f677b9b42ebf22">◆ </a></span>movePosition()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::movePosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>npos</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Moves the position from the current location to the desired location, adjusting the corridor as needed to reflect the change. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">npos</td><td>The desired new position. [(x, y, z)] </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">navquery</td><td>The query object used to build the corridor. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>The filter to apply to the operation. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Returns true if move succeeded.</dd></dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>Behavior:</p>
|
|
<ul>
|
|
<li>The movement is constrained to the surface of the navigation mesh.</li>
|
|
<li>The corridor is automatically adjusted (shorted or lengthened) in order to remain valid.</li>
|
|
<li>The new position will be located in the adjusted corridor's first polygon.</li>
|
|
</ul>
|
|
<p>The expected use case is that the desired position will be 'near' the current corridor. What is considered 'near' depends on local polygon density, query search half extents, etc.</p>
|
|
<p>The resulting position will differ from the desired position if the desired position is not on the navigation mesh, or it can't be reached using a local search. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a66f8097a4f49c077b6c6da5c727c6877"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a66f8097a4f49c077b6c6da5c727c6877">◆ </a></span>moveTargetPosition()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::moveTargetPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>npos</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Moves the target from the curent location to the desired location, adjusting the corridor as needed to reflect the change. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">npos</td><td>The desired new target position. [(x, y, z)] </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">navquery</td><td>The query object used to build the corridor. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>The filter to apply to the operation. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Returns true if move succeeded.</dd></dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>Behavior:</p>
|
|
<ul>
|
|
<li>The movement is constrained to the surface of the navigation mesh.</li>
|
|
<li>The corridor is automatically adjusted (shorted or lengthened) in order to remain valid.</li>
|
|
<li>The new target will be located in the adjusted corridor's last polygon.</li>
|
|
</ul>
|
|
<p>The expected use case is that the desired target will be 'near' the current corridor. What is considered 'near' depends on local polygon density, query search half extents, etc.</p>
|
|
<p>The resulting target will differ from the desired target if the desired target is not on the navigation mesh, or it can't be reached using a local search. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a69288d28ab5d23b2c2654e45c5a33c25"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a69288d28ab5d23b2c2654e45c5a33c25">◆ </a></span>optimizePathTopology()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::optimizePathTopology </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Attempts to optimize the path using a local area search. </p>
|
|
<p>(Partial replanning.) </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">navquery</td><td>The query object used to build the corridor. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>The filter to apply to the operation. <br />
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>Inaccurate locomotion or dynamic obstacle avoidance can force the agent position significantly outside the original corridor. Over time this can result in the formation of a non-optimal corridor. This function will use a local area path search to try to re-optimize the corridor.</p>
|
|
<p>The more inaccurate the agent movement, the more beneficial this function becomes. Simply adjust the frequency of the call to match the needs to the agent. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3970b6cd229731debe6beb41d9885463"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3970b6cd229731debe6beb41d9885463">◆ </a></span>optimizePathVisibility()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void dtPathCorridor::optimizePathVisibility </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>next</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const float </td>
|
|
<td class="paramname"><em>pathOptimizationRange</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Attempts to optimize the path if the specified point is visible from the current position. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">next</td><td>The point to search toward. [(x, y, z]) </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">pathOptimizationRange</td><td>The maximum range to search. [Limit: > 0] </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">navquery</td><td>The query object used to build the corridor. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">filter</td><td>The filter to apply to the operation. <br />
|
|
</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>Inaccurate locomotion or dynamic obstacle avoidance can force the argent position significantly outside the original corridor. Over time this can result in the formation of a non-optimal corridor. Non-optimal paths can also form near the corners of tiles.</p>
|
|
<p>This function uses an efficient local visibility search to try to optimize the corridor between the current position and <code>next</code>.</p>
|
|
<p>The corridor will change only if <code>next</code> is visible from the current position and moving directly toward the point is better than following the existing path.</p>
|
|
<p>The more inaccurate the agent movement, the more beneficial this function becomes. Simply adjust the frequency of the call to match the needs to the agent.</p>
|
|
<p>This function is not suitable for long distance searches. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="abe057e7b5e1d6677e3d9eadb558df2b0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#abe057e7b5e1d6677e3d9eadb558df2b0">◆ </a></span>reset()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void dtPathCorridor::reset </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> </td>
|
|
<td class="paramname"><em>ref</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>pos</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Resets the path corridor to the specified position. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">ref</td><td>The polygon reference containing the position. </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">pos</td><td>The new position in the corridor. [(x, y, z)]</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>Essentially, the corridor is set of one polygon in size with the target equal to the position. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af26a1205a7e38f0389a2dcb2dc23ca9b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af26a1205a7e38f0389a2dcb2dc23ca9b">◆ </a></span>setCorridor()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void dtPathCorridor::setCorridor </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>target</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> * </td>
|
|
<td class="paramname"><em>path</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const int </td>
|
|
<td class="paramname"><em>npath</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Loads a new path and target into the corridor. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>The target location within the last polygon of the path. [(x, y, z)] </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">path</td><td>The path corridor. [(polyRef) * <code>npolys</code>] </td></tr>
|
|
<tr><td class="paramdir">[in]</td><td class="paramname">npath</td><td>The number of polygons in the path.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section user"><dt></dt><dd></dd></dl>
|
|
<p>The current corridor position is expected to be within the first polygon in the path. The target is expected to be in the last polygon.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>The size of the path must not exceed the size of corridor's path buffer set during <a class="el" href="classdtPathCorridor.html#a85b4c98157b68a57b9c3302f45d0ed7f" title="Allocates the corridor's path buffer.">init()</a>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5ed6daf1e663f2b0a854794e431514c8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5ed6daf1e663f2b0a854794e431514c8">◆ </a></span>trimInvalidPath()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool dtPathCorridor::trimInvalidPath </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="group__detour.html#gab4e0b2257a670c1a800057999612b466">dtPolyRef</a> </td>
|
|
<td class="paramname"><em>safeRef</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const float * </td>
|
|
<td class="paramname"><em>safePos</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classdtNavMeshQuery.html">dtNavMeshQuery</a> * </td>
|
|
<td class="paramname"><em>navquery</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classdtQueryFilter.html">dtQueryFilter</a> * </td>
|
|
<td class="paramname"><em>filter</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following files:<ul>
|
|
<li><a class="el" href="DetourPathCorridor_8h_source.html">DetourPathCorridor.h</a></li>
|
|
<li><a class="el" href="DetourPathCorridor_8cpp.html">DetourPathCorridor.cpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.6-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="classdtPathCorridor.html">dtPathCorridor</a></li>
|
|
<a href="https://github.com/recastnavigation/recastnavigation">Project Home</a>
|
|
| <a href="./License.txt">Licence (ZLib)</a>
|
|
| Copyright 2009 Mikko Mononen
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|