| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- <!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" lang="en-US">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=11"/>
- <meta name="generator" content="Doxygen 1.12.0"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>Jolt Physics: EPAPenetrationDepth 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>
- <script type="text/javascript" src="clipboard.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="cookie.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>
- <script type="text/x-mathjax-config">
- MathJax.Hub.Config({
- extensions: ["tex2jax.js"],
- jax: ["input/TeX","output/HTML-CSS"],
- });
- </script>
- <script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
- <link href="doxygen.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 id="projectrow">
- <td id="projectlogo"><img alt="Logo" src="LogoSmall.png"/></td>
- <td id="projectalign">
- <div id="projectname">Jolt Physics
- </div>
- <div id="projectbrief">A multi core friendly Game Physics Engine</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.12.0 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- var searchBox = new SearchBox("searchBox", "search/",'.html');
- /* @license-end */
- </script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- $(function() { codefold.init(0); });
- /* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- $(function() {
- initMenu('',true,false,'search.php','Search',true);
- $(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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- $(function(){initNavTree('class_e_p_a_penetration_depth.html',''); initResizable(true); });
- /* @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">
- <div id="MSearchResults">
- <div class="SRPage">
- <div id="SRIndex">
- <div id="SRResults"></div>
- <div class="SRStatus" id="Loading">Loading...</div>
- <div class="SRStatus" id="Searching">Searching...</div>
- <div class="SRStatus" id="NoMatches">No Matches</div>
- </div>
- </div>
- </div>
- </div>
- <div class="header">
- <div class="summary">
- <a href="#pub-types">Public Types</a> |
- <a href="#pub-methods">Public Member Functions</a> |
- <a href="class_e_p_a_penetration_depth-members.html">List of all members</a> </div>
- <div class="headertitle"><div class="title">EPAPenetrationDepth Class Reference</div></div>
- </div><!--header-->
- <div class="contents">
- <p><code>#include <<a class="el" href="_e_p_a_penetration_depth_8h_source.html">EPAPenetrationDepth.h</a>></code></p>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
- Public Types</h2></td></tr>
- <tr class="memitem:aab59ecfbbefc06c5ac96f9cdc24252d0" id="r_aab59ecfbbefc06c5ac96f9cdc24252d0"><td class="memItemLeft" align="right" valign="top">enum class  </td><td class="memItemRight" valign="bottom"><a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EStatus</a> { <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0a0497a652be066f6f966a97fa6c67c9c0">NotColliding</a>
- , <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0ae0f4d0dafbcf08dd28d80154056ad0d8">Colliding</a>
- , <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0aa2d00c353d1f9a5f07852650030dbd53">Indeterminate</a>
- }</td></tr>
- <tr class="memdesc:aab59ecfbbefc06c5ac96f9cdc24252d0"><td class="mdescLeft"> </td><td class="mdescRight">Return code for GetPenetrationDepthStepGJK. <a href="#aab59ecfbbefc06c5ac96f9cdc24252d0">More...</a><br /></td></tr>
- <tr class="separator:aab59ecfbbefc06c5ac96f9cdc24252d0"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
- Public Member Functions</h2></td></tr>
- <tr class="memitem:a903dc39955aae9b4e9eced5a396eb5a7" id="r_a903dc39955aae9b4e9eced5a396eb5a7"><td class="memTemplParams" colspan="2">template<typename AE , typename BE > </td></tr>
- <tr class="memitem:a903dc39955aae9b4e9eced5a396eb5a7"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EStatus</a> </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a903dc39955aae9b4e9eced5a396eb5a7">GetPenetrationDepthStepGJK</a> (const AE &inAExcludingConvexRadius, float inConvexRadiusA, const BE &inBExcludingConvexRadius, float inConvexRadiusB, float inTolerance, <a class="el" href="class_vec3.html">Vec3</a> &ioV, <a class="el" href="class_vec3.html">Vec3</a> &outPointA, <a class="el" href="class_vec3.html">Vec3</a> &outPointB)</td></tr>
- <tr class="separator:a903dc39955aae9b4e9eced5a396eb5a7"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:acff8a6121c0896e3aabbe3a18019f201" id="r_acff8a6121c0896e3aabbe3a18019f201"><td class="memTemplParams" colspan="2">template<typename AI , typename BI > </td></tr>
- <tr class="memitem:acff8a6121c0896e3aabbe3a18019f201"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#acff8a6121c0896e3aabbe3a18019f201">GetPenetrationDepthStepEPA</a> (const AI &inAIncludingConvexRadius, const BI &inBIncludingConvexRadius, float inTolerance, <a class="el" href="class_vec3.html">Vec3</a> &outV, <a class="el" href="class_vec3.html">Vec3</a> &outPointA, <a class="el" href="class_vec3.html">Vec3</a> &outPointB)</td></tr>
- <tr class="separator:acff8a6121c0896e3aabbe3a18019f201"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a8368ab4825b799eb57d6f6cf841087e2" id="r_a8368ab4825b799eb57d6f6cf841087e2"><td class="memTemplParams" colspan="2">template<typename AE , typename AI , typename BE , typename BI > </td></tr>
- <tr class="memitem:a8368ab4825b799eb57d6f6cf841087e2"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8368ab4825b799eb57d6f6cf841087e2">GetPenetrationDepth</a> (const AE &inAExcludingConvexRadius, const AI &inAIncludingConvexRadius, float inConvexRadiusA, const BE &inBExcludingConvexRadius, const BI &inBIncludingConvexRadius, float inConvexRadiusB, float inCollisionToleranceSq, float inPenetrationTolerance, <a class="el" href="class_vec3.html">Vec3</a> &ioV, <a class="el" href="class_vec3.html">Vec3</a> &outPointA, <a class="el" href="class_vec3.html">Vec3</a> &outPointB)</td></tr>
- <tr class="separator:a8368ab4825b799eb57d6f6cf841087e2"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a37aeff94cc5402fd0a98bb299803f543" id="r_a37aeff94cc5402fd0a98bb299803f543"><td class="memTemplParams" colspan="2">template<typename A , typename B > </td></tr>
- <tr class="memitem:a37aeff94cc5402fd0a98bb299803f543"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a37aeff94cc5402fd0a98bb299803f543">CastShape</a> (<a class="el" href="_math_types_8h.html#af10dd31c5ad4acb62aba8025732597e6">Mat44Arg</a> inStart, <a class="el" href="_math_types_8h.html#a6bc57c31f15cea47640b580d03737c68">Vec3Arg</a> inDirection, float inCollisionTolerance, float inPenetrationTolerance, const A &inA, const B &inB, float inConvexRadiusA, float inConvexRadiusB, bool inReturnDeepestPoint, float &ioLambda, <a class="el" href="class_vec3.html">Vec3</a> &outPointA, <a class="el" href="class_vec3.html">Vec3</a> &outPointB, <a class="el" href="class_vec3.html">Vec3</a> &outContactNormal)</td></tr>
- <tr class="separator:a37aeff94cc5402fd0a98bb299803f543"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
- <div class="textblock"><p>Implementation of Expanding Polytope Algorithm as described in:</p>
- <p>Proximity Queries and Penetration Depth Computation on 3D Game Objects - Gino van den Bergen</p>
- <p>The implementation of this algorithm does not completely follow the article, instead of splitting triangles at each edge as in fig. 7 in the article, we build a convex hull (removing any triangles that are facing the new point, thereby avoiding the problem of getting really oblong triangles as mentioned in the article).</p>
- <p>The algorithm roughly works like:</p>
- <ul>
- <li>Start with a simplex of the Minkowski sum (difference) of two objects that was calculated by GJK</li>
- <li>This simplex should contain the origin (or else GJK would have reported: no collision)</li>
- <li>In cases where the simplex consists of 1 - 3 points, find some extra support points (of the Minkowski sum) to get to at least 4 points</li>
- <li>Convert this into a convex hull with non-zero volume (which includes the origin)</li>
- <li>A: Calculate the closest point to the origin for all triangles of the hull and take the closest one</li>
- <li>Calculate a new support point (of the Minkowski sum) in this direction and add this point to the convex hull</li>
- <li>This will remove all faces that are facing the new point and will create new triangles to fill up the hole</li>
- <li>Loop to A until no closer point found</li>
- <li>The closest point indicates the position / direction of least penetration </li>
- </ul>
- </div><h2 class="groupheader">Member Enumeration Documentation</h2>
- <a id="aab59ecfbbefc06c5ac96f9cdc24252d0" name="aab59ecfbbefc06c5ac96f9cdc24252d0"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#aab59ecfbbefc06c5ac96f9cdc24252d0">◆ </a></span>EStatus</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">enum class <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EPAPenetrationDepth::EStatus</a></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">strong</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Return code for GetPenetrationDepthStepGJK. </p>
- <table class="fieldtable">
- <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aab59ecfbbefc06c5ac96f9cdc24252d0a0497a652be066f6f966a97fa6c67c9c0" name="aab59ecfbbefc06c5ac96f9cdc24252d0a0497a652be066f6f966a97fa6c67c9c0"></a>NotColliding </td><td class="fielddoc"><p>Returned if the objects don't collide, in this case outPointA/outPointB are invalid. </p>
- </td></tr>
- <tr><td class="fieldname"><a id="aab59ecfbbefc06c5ac96f9cdc24252d0ae0f4d0dafbcf08dd28d80154056ad0d8" name="aab59ecfbbefc06c5ac96f9cdc24252d0ae0f4d0dafbcf08dd28d80154056ad0d8"></a>Colliding </td><td class="fielddoc"><p>Returned if the objects penetrate. </p>
- </td></tr>
- <tr><td class="fieldname"><a id="aab59ecfbbefc06c5ac96f9cdc24252d0aa2d00c353d1f9a5f07852650030dbd53" name="aab59ecfbbefc06c5ac96f9cdc24252d0aa2d00c353d1f9a5f07852650030dbd53"></a>Indeterminate </td><td class="fielddoc"><p>Returned if the objects penetrate further than the convex radius. In this case you need to call GetPenetrationDepthStepEPA to get the actual penetration depth. </p>
- </td></tr>
- </table>
- </div>
- </div>
- <h2 class="groupheader">Member Function Documentation</h2>
- <a id="a37aeff94cc5402fd0a98bb299803f543" name="a37aeff94cc5402fd0a98bb299803f543"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a37aeff94cc5402fd0a98bb299803f543">◆ </a></span>CastShape()</h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename A , typename B > </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">bool EPAPenetrationDepth::CastShape </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="_math_types_8h.html#af10dd31c5ad4acb62aba8025732597e6">Mat44Arg</a></td> <td class="paramname"><span class="paramname"><em>inStart</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="_math_types_8h.html#a6bc57c31f15cea47640b580d03737c68">Vec3Arg</a></td> <td class="paramname"><span class="paramname"><em>inDirection</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inCollisionTolerance</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inPenetrationTolerance</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const A &</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const B &</td> <td class="paramname"><span class="paramname"><em>inB</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>inReturnDeepestPoint</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float &</td> <td class="paramname"><span class="paramname"><em>ioLambda</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outContactNormal</em></span> )</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>Test if a cast shape inA moving from inStart to lambda * inStart.GetTranslation() + inDirection where lambda e [0, ioLambda> intersects inB</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">inStart</td><td>Start position and orientation of the convex object </td></tr>
- <tr><td class="paramname">inDirection</td><td>Direction of the sweep (ioLambda * inDirection determines length) </td></tr>
- <tr><td class="paramname">inCollisionTolerance</td><td>The minimal distance between A and B before they are considered colliding </td></tr>
- <tr><td class="paramname">inPenetrationTolerance</td><td>A factor that determines the accuracy of the result. If the change of the squared distance is less than inTolerance * current_penetration_depth^2 the algorithm will terminate. Should be bigger or equal to FLT_EPSILON. </td></tr>
- <tr><td class="paramname">inA</td><td>The convex object A, must support the GetSupport(Vec3) function. </td></tr>
- <tr><td class="paramname">inB</td><td>The convex object B, must support the GetSupport(Vec3) function. </td></tr>
- <tr><td class="paramname">inConvexRadiusA</td><td>The convex radius of A, this will be added on all sides to pad A. </td></tr>
- <tr><td class="paramname">inConvexRadiusB</td><td>The convex radius of B, this will be added on all sides to pad B. </td></tr>
- <tr><td class="paramname">inReturnDeepestPoint</td><td>If the shapes are initially intersecting this determines if the EPA algorithm will run to find the deepest point </td></tr>
- <tr><td class="paramname">ioLambda</td><td>The max fraction along the sweep, on output updated with the actual collision fraction. </td></tr>
- <tr><td class="paramname">outPointA</td><td>is the contact point on A </td></tr>
- <tr><td class="paramname">outPointB</td><td>is the contact point on B </td></tr>
- <tr><td class="paramname">outContactNormal</td><td>is either the contact normal when the objects are touching or the penetration axis when the objects are penetrating at the start of the sweep (pointing from A to B, length will not be 1)</td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>true if the a hit was found, in which case ioLambda, outPointA, outPointB and outSurfaceNormal are updated. </dd></dl>
- </div>
- </div>
- <a id="a8368ab4825b799eb57d6f6cf841087e2" name="a8368ab4825b799eb57d6f6cf841087e2"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a8368ab4825b799eb57d6f6cf841087e2">◆ </a></span>GetPenetrationDepth()</h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename AE , typename AI , typename BE , typename BI > </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">bool EPAPenetrationDepth::GetPenetrationDepth </td>
- <td>(</td>
- <td class="paramtype">const AE &</td> <td class="paramname"><span class="paramname"><em>inAExcludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const AI &</td> <td class="paramname"><span class="paramname"><em>inAIncludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const BE &</td> <td class="paramname"><span class="paramname"><em>inBExcludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const BI &</td> <td class="paramname"><span class="paramname"><em>inBIncludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inCollisionToleranceSq</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inPenetrationTolerance</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>ioV</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span> )</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>This function combines the GJK and EPA steps and is provided as a convenience function. Note: less performant since you're providing all support functions in one go Note 2: You need to initialize ioV, see documentation at GetPenetrationDepthStepGJK! </p>
- </div>
- </div>
- <a id="acff8a6121c0896e3aabbe3a18019f201" name="acff8a6121c0896e3aabbe3a18019f201"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#acff8a6121c0896e3aabbe3a18019f201">◆ </a></span>GetPenetrationDepthStepEPA()</h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename AI , typename BI > </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">bool EPAPenetrationDepth::GetPenetrationDepthStepEPA </td>
- <td>(</td>
- <td class="paramtype">const AI &</td> <td class="paramname"><span class="paramname"><em>inAIncludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const BI &</td> <td class="paramname"><span class="paramname"><em>inBIncludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outV</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span> )</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>Calculates penetration depth between two objects, second step (the EPA step)</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">inAIncludingConvexRadius</td><td>Object A with convex radius </td></tr>
- <tr><td class="paramname">inBIncludingConvexRadius</td><td>Object B with convex radius </td></tr>
- <tr><td class="paramname">inTolerance</td><td>A factor that determines the accuracy of the result. If the change of the squared distance is less than inTolerance * current_penetration_depth^2 the algorithm will terminate. Should be bigger or equal to FLT_EPSILON. </td></tr>
- <tr><td class="paramname">outV</td><td>Direction to move B out of collision along the shortest path (magnitude is meaningless) </td></tr>
- <tr><td class="paramname">outPointA</td><td>Position on A that has the least amount of penetration </td></tr>
- <tr><td class="paramname">outPointB</td><td>Position on B that has the least amount of penetration Use |outPointB - outPointA| to get the distance of penetration</td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>False if the objects don't collide, in this case outPointA/outPointB are invalid. True if the objects penetrate </dd></dl>
- </div>
- </div>
- <a id="a903dc39955aae9b4e9eced5a396eb5a7" name="a903dc39955aae9b4e9eced5a396eb5a7"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a903dc39955aae9b4e9eced5a396eb5a7">◆ </a></span>GetPenetrationDepthStepGJK()</h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename AE , typename BE > </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EStatus</a> EPAPenetrationDepth::GetPenetrationDepthStepGJK </td>
- <td>(</td>
- <td class="paramtype">const AE &</td> <td class="paramname"><span class="paramname"><em>inAExcludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const BE &</td> <td class="paramname"><span class="paramname"><em>inBExcludingConvexRadius</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>ioV</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span> )</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>Calculates penetration depth between two objects, first step of two (the GJK step)</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">inAExcludingConvexRadius</td><td>Object A without convex radius. </td></tr>
- <tr><td class="paramname">inBExcludingConvexRadius</td><td>Object B without convex radius. </td></tr>
- <tr><td class="paramname">inConvexRadiusA</td><td>Convex radius for A. </td></tr>
- <tr><td class="paramname">inConvexRadiusB</td><td>Convex radius for B. </td></tr>
- <tr><td class="paramname">ioV</td><td>Pass in previously returned value or (1, 0, 0). On return this value is changed to direction to move B out of collision along the shortest path (magnitude is meaningless). </td></tr>
- <tr><td class="paramname">inTolerance</td><td>Minimal distance before A and B are considered colliding. </td></tr>
- <tr><td class="paramname">outPointA</td><td>Position on A that has the least amount of penetration. </td></tr>
- <tr><td class="paramname">outPointB</td><td>Position on B that has the least amount of penetration. Use |outPointB - outPointA| to get the distance of penetration. </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <hr/>The documentation for this class was generated from the following file:<ul>
- <li>Jolt/Geometry/<a class="el" href="_e_p_a_penetration_depth_8h_source.html">EPAPenetrationDepth.h</a></li>
- </ul>
- </div><!-- contents -->
- </div><!-- doc-content -->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="class_e_p_a_penetration_depth.html">EPAPenetrationDepth</a></li>
- <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
- </ul>
- </div>
- </body>
- </html>
|