class_e_p_a_penetration_depth.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=11"/>
  6. <meta name="generator" content="Doxygen 1.12.0"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>Jolt Physics: EPAPenetrationDepth Class Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <script type="text/javascript" src="clipboard.js"></script>
  13. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript" src="resize.js"></script>
  17. <script type="text/javascript" src="cookie.js"></script>
  18. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  19. <script type="text/javascript" src="search/searchdata.js"></script>
  20. <script type="text/javascript" src="search/search.js"></script>
  21. <script type="text/x-mathjax-config">
  22. MathJax.Hub.Config({
  23. extensions: ["tex2jax.js"],
  24. jax: ["input/TeX","output/HTML-CSS"],
  25. });
  26. </script>
  27. <script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
  28. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  29. </head>
  30. <body>
  31. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  32. <div id="titlearea">
  33. <table cellspacing="0" cellpadding="0">
  34. <tbody>
  35. <tr id="projectrow">
  36. <td id="projectlogo"><img alt="Logo" src="LogoSmall.png"/></td>
  37. <td id="projectalign">
  38. <div id="projectname">Jolt Physics
  39. </div>
  40. <div id="projectbrief">A multi core friendly Game Physics Engine</div>
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. <!-- end header part -->
  47. <!-- Generated by Doxygen 1.12.0 -->
  48. <script type="text/javascript">
  49. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  50. var searchBox = new SearchBox("searchBox", "search/",'.html');
  51. /* @license-end */
  52. </script>
  53. <script type="text/javascript">
  54. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  55. $(function() { codefold.init(0); });
  56. /* @license-end */
  57. </script>
  58. <script type="text/javascript" src="menudata.js"></script>
  59. <script type="text/javascript" src="menu.js"></script>
  60. <script type="text/javascript">
  61. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  62. $(function() {
  63. initMenu('',true,false,'search.php','Search',true);
  64. $(function() { init_search(); });
  65. });
  66. /* @license-end */
  67. </script>
  68. <div id="main-nav"></div>
  69. </div><!-- top -->
  70. <div id="side-nav" class="ui-resizable side-nav-resizable">
  71. <div id="nav-tree">
  72. <div id="nav-tree-contents">
  73. <div id="nav-sync" class="sync"></div>
  74. </div>
  75. </div>
  76. <div id="splitbar" style="-moz-user-select:none;"
  77. class="ui-resizable-handle">
  78. </div>
  79. </div>
  80. <script type="text/javascript">
  81. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  82. $(function(){initNavTree('class_e_p_a_penetration_depth.html',''); initResizable(true); });
  83. /* @license-end */
  84. </script>
  85. <div id="doc-content">
  86. <!-- window showing the filter options -->
  87. <div id="MSearchSelectWindow"
  88. onmouseover="return searchBox.OnSearchSelectShow()"
  89. onmouseout="return searchBox.OnSearchSelectHide()"
  90. onkeydown="return searchBox.OnSearchSelectKey(event)">
  91. </div>
  92. <!-- iframe showing the search results (closed by default) -->
  93. <div id="MSearchResultsWindow">
  94. <div id="MSearchResults">
  95. <div class="SRPage">
  96. <div id="SRIndex">
  97. <div id="SRResults"></div>
  98. <div class="SRStatus" id="Loading">Loading...</div>
  99. <div class="SRStatus" id="Searching">Searching...</div>
  100. <div class="SRStatus" id="NoMatches">No Matches</div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="header">
  106. <div class="summary">
  107. <a href="#pub-types">Public Types</a> &#124;
  108. <a href="#pub-methods">Public Member Functions</a> &#124;
  109. <a href="class_e_p_a_penetration_depth-members.html">List of all members</a> </div>
  110. <div class="headertitle"><div class="title">EPAPenetrationDepth Class Reference</div></div>
  111. </div><!--header-->
  112. <div class="contents">
  113. <p><code>#include &lt;<a class="el" href="_e_p_a_penetration_depth_8h_source.html">EPAPenetrationDepth.h</a>&gt;</code></p>
  114. <table class="memberdecls">
  115. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
  116. Public Types</h2></td></tr>
  117. <tr class="memitem:aab59ecfbbefc06c5ac96f9cdc24252d0" id="r_aab59ecfbbefc06c5ac96f9cdc24252d0"><td class="memItemLeft" align="right" valign="top">enum class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EStatus</a> { <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0a0497a652be066f6f966a97fa6c67c9c0">NotColliding</a>
  118. , <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0ae0f4d0dafbcf08dd28d80154056ad0d8">Colliding</a>
  119. , <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0aa2d00c353d1f9a5f07852650030dbd53">Indeterminate</a>
  120. }</td></tr>
  121. <tr class="memdesc:aab59ecfbbefc06c5ac96f9cdc24252d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code for GetPenetrationDepthStepGJK. <a href="#aab59ecfbbefc06c5ac96f9cdc24252d0">More...</a><br /></td></tr>
  122. <tr class="separator:aab59ecfbbefc06c5ac96f9cdc24252d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. </table><table class="memberdecls">
  124. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
  125. Public Member Functions</h2></td></tr>
  126. <tr class="memitem:a903dc39955aae9b4e9eced5a396eb5a7" id="r_a903dc39955aae9b4e9eced5a396eb5a7"><td class="memTemplParams" colspan="2">template&lt;typename AE , typename BE &gt; </td></tr>
  127. <tr class="memitem:a903dc39955aae9b4e9eced5a396eb5a7"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EStatus</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a903dc39955aae9b4e9eced5a396eb5a7">GetPenetrationDepthStepGJK</a> (const AE &amp;inAExcludingConvexRadius, float inConvexRadiusA, const BE &amp;inBExcludingConvexRadius, float inConvexRadiusB, float inTolerance, <a class="el" href="class_vec3.html">Vec3</a> &amp;ioV, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointA, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointB)</td></tr>
  128. <tr class="separator:a903dc39955aae9b4e9eced5a396eb5a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  129. <tr class="memitem:acff8a6121c0896e3aabbe3a18019f201" id="r_acff8a6121c0896e3aabbe3a18019f201"><td class="memTemplParams" colspan="2">template&lt;typename AI , typename BI &gt; </td></tr>
  130. <tr class="memitem:acff8a6121c0896e3aabbe3a18019f201"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#acff8a6121c0896e3aabbe3a18019f201">GetPenetrationDepthStepEPA</a> (const AI &amp;inAIncludingConvexRadius, const BI &amp;inBIncludingConvexRadius, float inTolerance, <a class="el" href="class_vec3.html">Vec3</a> &amp;outV, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointA, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointB)</td></tr>
  131. <tr class="separator:acff8a6121c0896e3aabbe3a18019f201"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:a8368ab4825b799eb57d6f6cf841087e2" id="r_a8368ab4825b799eb57d6f6cf841087e2"><td class="memTemplParams" colspan="2">template&lt;typename AE , typename AI , typename BE , typename BI &gt; </td></tr>
  133. <tr class="memitem:a8368ab4825b799eb57d6f6cf841087e2"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8368ab4825b799eb57d6f6cf841087e2">GetPenetrationDepth</a> (const AE &amp;inAExcludingConvexRadius, const AI &amp;inAIncludingConvexRadius, float inConvexRadiusA, const BE &amp;inBExcludingConvexRadius, const BI &amp;inBIncludingConvexRadius, float inConvexRadiusB, float inCollisionToleranceSq, float inPenetrationTolerance, <a class="el" href="class_vec3.html">Vec3</a> &amp;ioV, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointA, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointB)</td></tr>
  134. <tr class="separator:a8368ab4825b799eb57d6f6cf841087e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a37aeff94cc5402fd0a98bb299803f543" id="r_a37aeff94cc5402fd0a98bb299803f543"><td class="memTemplParams" colspan="2">template&lt;typename A , typename B &gt; </td></tr>
  136. <tr class="memitem:a37aeff94cc5402fd0a98bb299803f543"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</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 &amp;inA, const B &amp;inB, float inConvexRadiusA, float inConvexRadiusB, bool inReturnDeepestPoint, float &amp;ioLambda, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointA, <a class="el" href="class_vec3.html">Vec3</a> &amp;outPointB, <a class="el" href="class_vec3.html">Vec3</a> &amp;outContactNormal)</td></tr>
  137. <tr class="separator:a37aeff94cc5402fd0a98bb299803f543"><td class="memSeparator" colspan="2">&#160;</td></tr>
  138. </table>
  139. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  140. <div class="textblock"><p>Implementation of Expanding Polytope Algorithm as described in:</p>
  141. <p>Proximity Queries and Penetration Depth Computation on 3D Game Objects - Gino van den Bergen</p>
  142. <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>
  143. <p>The algorithm roughly works like:</p>
  144. <ul>
  145. <li>Start with a simplex of the Minkowski sum (difference) of two objects that was calculated by GJK</li>
  146. <li>This simplex should contain the origin (or else GJK would have reported: no collision)</li>
  147. <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>
  148. <li>Convert this into a convex hull with non-zero volume (which includes the origin)</li>
  149. <li>A: Calculate the closest point to the origin for all triangles of the hull and take the closest one</li>
  150. <li>Calculate a new support point (of the Minkowski sum) in this direction and add this point to the convex hull</li>
  151. <li>This will remove all faces that are facing the new point and will create new triangles to fill up the hole</li>
  152. <li>Loop to A until no closer point found</li>
  153. <li>The closest point indicates the position / direction of least penetration </li>
  154. </ul>
  155. </div><h2 class="groupheader">Member Enumeration Documentation</h2>
  156. <a id="aab59ecfbbefc06c5ac96f9cdc24252d0" name="aab59ecfbbefc06c5ac96f9cdc24252d0"></a>
  157. <h2 class="memtitle"><span class="permalink"><a href="#aab59ecfbbefc06c5ac96f9cdc24252d0">&#9670;&#160;</a></span>EStatus</h2>
  158. <div class="memitem">
  159. <div class="memproto">
  160. <table class="mlabels">
  161. <tr>
  162. <td class="mlabels-left">
  163. <table class="memname">
  164. <tr>
  165. <td class="memname">enum class <a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EPAPenetrationDepth::EStatus</a></td>
  166. </tr>
  167. </table>
  168. </td>
  169. <td class="mlabels-right">
  170. <span class="mlabels"><span class="mlabel">strong</span></span> </td>
  171. </tr>
  172. </table>
  173. </div><div class="memdoc">
  174. <p>Return code for GetPenetrationDepthStepGJK. </p>
  175. <table class="fieldtable">
  176. <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aab59ecfbbefc06c5ac96f9cdc24252d0a0497a652be066f6f966a97fa6c67c9c0" name="aab59ecfbbefc06c5ac96f9cdc24252d0a0497a652be066f6f966a97fa6c67c9c0"></a>NotColliding&#160;</td><td class="fielddoc"><p>Returned if the objects don't collide, in this case outPointA/outPointB are invalid. </p>
  177. </td></tr>
  178. <tr><td class="fieldname"><a id="aab59ecfbbefc06c5ac96f9cdc24252d0ae0f4d0dafbcf08dd28d80154056ad0d8" name="aab59ecfbbefc06c5ac96f9cdc24252d0ae0f4d0dafbcf08dd28d80154056ad0d8"></a>Colliding&#160;</td><td class="fielddoc"><p>Returned if the objects penetrate. </p>
  179. </td></tr>
  180. <tr><td class="fieldname"><a id="aab59ecfbbefc06c5ac96f9cdc24252d0aa2d00c353d1f9a5f07852650030dbd53" name="aab59ecfbbefc06c5ac96f9cdc24252d0aa2d00c353d1f9a5f07852650030dbd53"></a>Indeterminate&#160;</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>
  181. </td></tr>
  182. </table>
  183. </div>
  184. </div>
  185. <h2 class="groupheader">Member Function Documentation</h2>
  186. <a id="a37aeff94cc5402fd0a98bb299803f543" name="a37aeff94cc5402fd0a98bb299803f543"></a>
  187. <h2 class="memtitle"><span class="permalink"><a href="#a37aeff94cc5402fd0a98bb299803f543">&#9670;&#160;</a></span>CastShape()</h2>
  188. <div class="memitem">
  189. <div class="memproto">
  190. <div class="memtemplate">
  191. template&lt;typename A , typename B &gt; </div>
  192. <table class="mlabels">
  193. <tr>
  194. <td class="mlabels-left">
  195. <table class="memname">
  196. <tr>
  197. <td class="memname">bool EPAPenetrationDepth::CastShape </td>
  198. <td>(</td>
  199. <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>
  200. </tr>
  201. <tr>
  202. <td class="paramkey"></td>
  203. <td></td>
  204. <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>
  205. </tr>
  206. <tr>
  207. <td class="paramkey"></td>
  208. <td></td>
  209. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inCollisionTolerance</em></span>, </td>
  210. </tr>
  211. <tr>
  212. <td class="paramkey"></td>
  213. <td></td>
  214. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inPenetrationTolerance</em></span>, </td>
  215. </tr>
  216. <tr>
  217. <td class="paramkey"></td>
  218. <td></td>
  219. <td class="paramtype">const A &amp;</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
  220. </tr>
  221. <tr>
  222. <td class="paramkey"></td>
  223. <td></td>
  224. <td class="paramtype">const B &amp;</td> <td class="paramname"><span class="paramname"><em>inB</em></span>, </td>
  225. </tr>
  226. <tr>
  227. <td class="paramkey"></td>
  228. <td></td>
  229. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
  230. </tr>
  231. <tr>
  232. <td class="paramkey"></td>
  233. <td></td>
  234. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
  235. </tr>
  236. <tr>
  237. <td class="paramkey"></td>
  238. <td></td>
  239. <td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>inReturnDeepestPoint</em></span>, </td>
  240. </tr>
  241. <tr>
  242. <td class="paramkey"></td>
  243. <td></td>
  244. <td class="paramtype">float &amp;</td> <td class="paramname"><span class="paramname"><em>ioLambda</em></span>, </td>
  245. </tr>
  246. <tr>
  247. <td class="paramkey"></td>
  248. <td></td>
  249. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
  250. </tr>
  251. <tr>
  252. <td class="paramkey"></td>
  253. <td></td>
  254. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span>, </td>
  255. </tr>
  256. <tr>
  257. <td class="paramkey"></td>
  258. <td></td>
  259. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outContactNormal</em></span>&#160;)</td>
  260. </tr>
  261. </table>
  262. </td>
  263. <td class="mlabels-right">
  264. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  265. </tr>
  266. </table>
  267. </div><div class="memdoc">
  268. <p>Test if a cast shape inA moving from inStart to lambda * inStart.GetTranslation() + inDirection where lambda e [0, ioLambda&gt; intersects inB</p>
  269. <dl class="params"><dt>Parameters</dt><dd>
  270. <table class="params">
  271. <tr><td class="paramname">inStart</td><td>Start position and orientation of the convex object </td></tr>
  272. <tr><td class="paramname">inDirection</td><td>Direction of the sweep (ioLambda * inDirection determines length) </td></tr>
  273. <tr><td class="paramname">inCollisionTolerance</td><td>The minimal distance between A and B before they are considered colliding </td></tr>
  274. <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>
  275. <tr><td class="paramname">inA</td><td>The convex object A, must support the GetSupport(Vec3) function. </td></tr>
  276. <tr><td class="paramname">inB</td><td>The convex object B, must support the GetSupport(Vec3) function. </td></tr>
  277. <tr><td class="paramname">inConvexRadiusA</td><td>The convex radius of A, this will be added on all sides to pad A. </td></tr>
  278. <tr><td class="paramname">inConvexRadiusB</td><td>The convex radius of B, this will be added on all sides to pad B. </td></tr>
  279. <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>
  280. <tr><td class="paramname">ioLambda</td><td>The max fraction along the sweep, on output updated with the actual collision fraction. </td></tr>
  281. <tr><td class="paramname">outPointA</td><td>is the contact point on A </td></tr>
  282. <tr><td class="paramname">outPointB</td><td>is the contact point on B </td></tr>
  283. <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>
  284. </table>
  285. </dd>
  286. </dl>
  287. <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>
  288. </div>
  289. </div>
  290. <a id="a8368ab4825b799eb57d6f6cf841087e2" name="a8368ab4825b799eb57d6f6cf841087e2"></a>
  291. <h2 class="memtitle"><span class="permalink"><a href="#a8368ab4825b799eb57d6f6cf841087e2">&#9670;&#160;</a></span>GetPenetrationDepth()</h2>
  292. <div class="memitem">
  293. <div class="memproto">
  294. <div class="memtemplate">
  295. template&lt;typename AE , typename AI , typename BE , typename BI &gt; </div>
  296. <table class="mlabels">
  297. <tr>
  298. <td class="mlabels-left">
  299. <table class="memname">
  300. <tr>
  301. <td class="memname">bool EPAPenetrationDepth::GetPenetrationDepth </td>
  302. <td>(</td>
  303. <td class="paramtype">const AE &amp;</td> <td class="paramname"><span class="paramname"><em>inAExcludingConvexRadius</em></span>, </td>
  304. </tr>
  305. <tr>
  306. <td class="paramkey"></td>
  307. <td></td>
  308. <td class="paramtype">const AI &amp;</td> <td class="paramname"><span class="paramname"><em>inAIncludingConvexRadius</em></span>, </td>
  309. </tr>
  310. <tr>
  311. <td class="paramkey"></td>
  312. <td></td>
  313. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
  314. </tr>
  315. <tr>
  316. <td class="paramkey"></td>
  317. <td></td>
  318. <td class="paramtype">const BE &amp;</td> <td class="paramname"><span class="paramname"><em>inBExcludingConvexRadius</em></span>, </td>
  319. </tr>
  320. <tr>
  321. <td class="paramkey"></td>
  322. <td></td>
  323. <td class="paramtype">const BI &amp;</td> <td class="paramname"><span class="paramname"><em>inBIncludingConvexRadius</em></span>, </td>
  324. </tr>
  325. <tr>
  326. <td class="paramkey"></td>
  327. <td></td>
  328. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
  329. </tr>
  330. <tr>
  331. <td class="paramkey"></td>
  332. <td></td>
  333. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inCollisionToleranceSq</em></span>, </td>
  334. </tr>
  335. <tr>
  336. <td class="paramkey"></td>
  337. <td></td>
  338. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inPenetrationTolerance</em></span>, </td>
  339. </tr>
  340. <tr>
  341. <td class="paramkey"></td>
  342. <td></td>
  343. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioV</em></span>, </td>
  344. </tr>
  345. <tr>
  346. <td class="paramkey"></td>
  347. <td></td>
  348. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
  349. </tr>
  350. <tr>
  351. <td class="paramkey"></td>
  352. <td></td>
  353. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span>&#160;)</td>
  354. </tr>
  355. </table>
  356. </td>
  357. <td class="mlabels-right">
  358. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  359. </tr>
  360. </table>
  361. </div><div class="memdoc">
  362. <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>
  363. </div>
  364. </div>
  365. <a id="acff8a6121c0896e3aabbe3a18019f201" name="acff8a6121c0896e3aabbe3a18019f201"></a>
  366. <h2 class="memtitle"><span class="permalink"><a href="#acff8a6121c0896e3aabbe3a18019f201">&#9670;&#160;</a></span>GetPenetrationDepthStepEPA()</h2>
  367. <div class="memitem">
  368. <div class="memproto">
  369. <div class="memtemplate">
  370. template&lt;typename AI , typename BI &gt; </div>
  371. <table class="mlabels">
  372. <tr>
  373. <td class="mlabels-left">
  374. <table class="memname">
  375. <tr>
  376. <td class="memname">bool EPAPenetrationDepth::GetPenetrationDepthStepEPA </td>
  377. <td>(</td>
  378. <td class="paramtype">const AI &amp;</td> <td class="paramname"><span class="paramname"><em>inAIncludingConvexRadius</em></span>, </td>
  379. </tr>
  380. <tr>
  381. <td class="paramkey"></td>
  382. <td></td>
  383. <td class="paramtype">const BI &amp;</td> <td class="paramname"><span class="paramname"><em>inBIncludingConvexRadius</em></span>, </td>
  384. </tr>
  385. <tr>
  386. <td class="paramkey"></td>
  387. <td></td>
  388. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  389. </tr>
  390. <tr>
  391. <td class="paramkey"></td>
  392. <td></td>
  393. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outV</em></span>, </td>
  394. </tr>
  395. <tr>
  396. <td class="paramkey"></td>
  397. <td></td>
  398. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
  399. </tr>
  400. <tr>
  401. <td class="paramkey"></td>
  402. <td></td>
  403. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span>&#160;)</td>
  404. </tr>
  405. </table>
  406. </td>
  407. <td class="mlabels-right">
  408. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  409. </tr>
  410. </table>
  411. </div><div class="memdoc">
  412. <p>Calculates penetration depth between two objects, second step (the EPA step)</p>
  413. <dl class="params"><dt>Parameters</dt><dd>
  414. <table class="params">
  415. <tr><td class="paramname">inAIncludingConvexRadius</td><td>Object A with convex radius </td></tr>
  416. <tr><td class="paramname">inBIncludingConvexRadius</td><td>Object B with convex radius </td></tr>
  417. <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>
  418. <tr><td class="paramname">outV</td><td>Direction to move B out of collision along the shortest path (magnitude is meaningless) </td></tr>
  419. <tr><td class="paramname">outPointA</td><td>Position on A that has the least amount of penetration </td></tr>
  420. <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>
  421. </table>
  422. </dd>
  423. </dl>
  424. <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>
  425. </div>
  426. </div>
  427. <a id="a903dc39955aae9b4e9eced5a396eb5a7" name="a903dc39955aae9b4e9eced5a396eb5a7"></a>
  428. <h2 class="memtitle"><span class="permalink"><a href="#a903dc39955aae9b4e9eced5a396eb5a7">&#9670;&#160;</a></span>GetPenetrationDepthStepGJK()</h2>
  429. <div class="memitem">
  430. <div class="memproto">
  431. <div class="memtemplate">
  432. template&lt;typename AE , typename BE &gt; </div>
  433. <table class="mlabels">
  434. <tr>
  435. <td class="mlabels-left">
  436. <table class="memname">
  437. <tr>
  438. <td class="memname"><a class="el" href="#aab59ecfbbefc06c5ac96f9cdc24252d0">EStatus</a> EPAPenetrationDepth::GetPenetrationDepthStepGJK </td>
  439. <td>(</td>
  440. <td class="paramtype">const AE &amp;</td> <td class="paramname"><span class="paramname"><em>inAExcludingConvexRadius</em></span>, </td>
  441. </tr>
  442. <tr>
  443. <td class="paramkey"></td>
  444. <td></td>
  445. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
  446. </tr>
  447. <tr>
  448. <td class="paramkey"></td>
  449. <td></td>
  450. <td class="paramtype">const BE &amp;</td> <td class="paramname"><span class="paramname"><em>inBExcludingConvexRadius</em></span>, </td>
  451. </tr>
  452. <tr>
  453. <td class="paramkey"></td>
  454. <td></td>
  455. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
  456. </tr>
  457. <tr>
  458. <td class="paramkey"></td>
  459. <td></td>
  460. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  461. </tr>
  462. <tr>
  463. <td class="paramkey"></td>
  464. <td></td>
  465. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioV</em></span>, </td>
  466. </tr>
  467. <tr>
  468. <td class="paramkey"></td>
  469. <td></td>
  470. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointA</em></span>, </td>
  471. </tr>
  472. <tr>
  473. <td class="paramkey"></td>
  474. <td></td>
  475. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outPointB</em></span>&#160;)</td>
  476. </tr>
  477. </table>
  478. </td>
  479. <td class="mlabels-right">
  480. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  481. </tr>
  482. </table>
  483. </div><div class="memdoc">
  484. <p>Calculates penetration depth between two objects, first step of two (the GJK step)</p>
  485. <dl class="params"><dt>Parameters</dt><dd>
  486. <table class="params">
  487. <tr><td class="paramname">inAExcludingConvexRadius</td><td>Object A without convex radius. </td></tr>
  488. <tr><td class="paramname">inBExcludingConvexRadius</td><td>Object B without convex radius. </td></tr>
  489. <tr><td class="paramname">inConvexRadiusA</td><td>Convex radius for A. </td></tr>
  490. <tr><td class="paramname">inConvexRadiusB</td><td>Convex radius for B. </td></tr>
  491. <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>
  492. <tr><td class="paramname">inTolerance</td><td>Minimal distance before A and B are considered colliding. </td></tr>
  493. <tr><td class="paramname">outPointA</td><td>Position on A that has the least amount of penetration. </td></tr>
  494. <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>
  495. </table>
  496. </dd>
  497. </dl>
  498. </div>
  499. </div>
  500. <hr/>The documentation for this class was generated from the following file:<ul>
  501. <li>Jolt/Geometry/<a class="el" href="_e_p_a_penetration_depth_8h_source.html">EPAPenetrationDepth.h</a></li>
  502. </ul>
  503. </div><!-- contents -->
  504. </div><!-- doc-content -->
  505. <!-- start footer part -->
  506. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  507. <ul>
  508. <li class="navelem"><a class="el" href="class_e_p_a_penetration_depth.html">EPAPenetrationDepth</a></li>
  509. <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>
  510. </ul>
  511. </div>
  512. </body>
  513. </html>