class_g_j_k_closest_point.html 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  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: GJKClosestPoint 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_g_j_k_closest_point.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-methods">Public Member Functions</a> &#124;
  108. <a href="class_g_j_k_closest_point-members.html">List of all members</a> </div>
  109. <div class="headertitle"><div class="title">GJKClosestPoint Class Reference</div></div>
  110. </div><!--header-->
  111. <div class="contents">
  112. <p><code>#include &lt;<a class="el" href="_g_j_k_closest_point_8h_source.html">GJKClosestPoint.h</a>&gt;</code></p>
  113. <div class="dynheader">
  114. Inheritance diagram for GJKClosestPoint:</div>
  115. <div class="dyncontent">
  116. <div class="center">
  117. <img src="class_g_j_k_closest_point.png" usemap="#GJKClosestPoint_map" alt=""/>
  118. <map id="GJKClosestPoint_map" name="GJKClosestPoint_map">
  119. <area href="class_non_copyable.html" title="Class that makes another class non-copyable. Usage: Inherit from NonCopyable." alt="NonCopyable" shape="rect" coords="0,0,105,24"/>
  120. </map>
  121. </div></div>
  122. <table class="memberdecls">
  123. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
  124. Public Member Functions</h2></td></tr>
  125. <tr class="memitem:a20ab4d36efcf62ceae244ec75eb4bc23" id="r_a20ab4d36efcf62ceae244ec75eb4bc23"><td class="memTemplParams" colspan="2">template&lt;typename A , typename B &gt; </td></tr>
  126. <tr class="memitem:a20ab4d36efcf62ceae244ec75eb4bc23"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a20ab4d36efcf62ceae244ec75eb4bc23">Intersects</a> (const A &amp;inA, const B &amp;inB, float inTolerance, <a class="el" href="class_vec3.html">Vec3</a> &amp;ioV)</td></tr>
  127. <tr class="separator:a20ab4d36efcf62ceae244ec75eb4bc23"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. <tr class="memitem:abb7cfdd49d708007d75b4c2e9b90ebb9" id="r_abb7cfdd49d708007d75b4c2e9b90ebb9"><td class="memTemplParams" colspan="2">template&lt;typename A , typename B &gt; </td></tr>
  129. <tr class="memitem:abb7cfdd49d708007d75b4c2e9b90ebb9"><td class="memTemplItemLeft" align="right" valign="top">float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#abb7cfdd49d708007d75b4c2e9b90ebb9">GetClosestPoints</a> (const A &amp;inA, const B &amp;inB, float inTolerance, float inMaxDistSq, <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>
  130. <tr class="separator:abb7cfdd49d708007d75b4c2e9b90ebb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:a73d6f276fb275026a0126ca7361fb2bf" id="r_a73d6f276fb275026a0126ca7361fb2bf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a73d6f276fb275026a0126ca7361fb2bf">GetClosestPointsSimplex</a> (<a class="el" href="class_vec3.html">Vec3</a> *outY, <a class="el" href="class_vec3.html">Vec3</a> *outP, <a class="el" href="class_vec3.html">Vec3</a> *outQ, <a class="el" href="_core_8h.html#a69aa29b598b851b0640aa225a9e5d61d">uint</a> &amp;outNumPoints) const</td></tr>
  132. <tr class="separator:a73d6f276fb275026a0126ca7361fb2bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. <tr class="memitem:ade3cde48252b6f77f749f9ac29685ec7" id="r_ade3cde48252b6f77f749f9ac29685ec7"><td class="memTemplParams" colspan="2">template&lt;typename A &gt; </td></tr>
  134. <tr class="memitem:ade3cde48252b6f77f749f9ac29685ec7"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#ade3cde48252b6f77f749f9ac29685ec7">CastRay</a> (<a class="el" href="_math_types_8h.html#a6bc57c31f15cea47640b580d03737c68">Vec3Arg</a> inRayOrigin, <a class="el" href="_math_types_8h.html#a6bc57c31f15cea47640b580d03737c68">Vec3Arg</a> inRayDirection, float inTolerance, const A &amp;inA, float &amp;ioLambda)</td></tr>
  135. <tr class="separator:ade3cde48252b6f77f749f9ac29685ec7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  136. <tr class="memitem:a66d20557ad6d34a1c1f29b6df058b523" id="r_a66d20557ad6d34a1c1f29b6df058b523"><td class="memTemplParams" colspan="2">template&lt;typename A , typename B &gt; </td></tr>
  137. <tr class="memitem:a66d20557ad6d34a1c1f29b6df058b523"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a66d20557ad6d34a1c1f29b6df058b523">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 inTolerance, const A &amp;inA, const B &amp;inB, float &amp;ioLambda)</td></tr>
  138. <tr class="separator:a66d20557ad6d34a1c1f29b6df058b523"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:aa5b19da7e23744cb5c1af8fe2fee2940" id="r_aa5b19da7e23744cb5c1af8fe2fee2940"><td class="memTemplParams" colspan="2">template&lt;typename A , typename B &gt; </td></tr>
  140. <tr class="memitem:aa5b19da7e23744cb5c1af8fe2fee2940"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#aa5b19da7e23744cb5c1af8fe2fee2940">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 inTolerance, const A &amp;inA, const B &amp;inB, float inConvexRadiusA, float inConvexRadiusB, 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;outSeparatingAxis)</td></tr>
  141. <tr class="separator:aa5b19da7e23744cb5c1af8fe2fee2940"><td class="memSeparator" colspan="2">&#160;</td></tr>
  142. <tr class="inherit_header pub_methods_class_non_copyable"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_class_non_copyable')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_non_copyable.html">NonCopyable</a></td></tr>
  143. <tr class="memitem:a809b6e4ade7ae32f6d248f2a3b783d45 inherit pub_methods_class_non_copyable" id="r_a809b6e4ade7ae32f6d248f2a3b783d45"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_non_copyable.html#a809b6e4ade7ae32f6d248f2a3b783d45">NonCopyable</a> ()=default</td></tr>
  144. <tr class="separator:a809b6e4ade7ae32f6d248f2a3b783d45 inherit pub_methods_class_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
  145. <tr class="memitem:a501d34ffcc34b30de6d541887a901057 inherit pub_methods_class_non_copyable" id="r_a501d34ffcc34b30de6d541887a901057"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_non_copyable.html#a501d34ffcc34b30de6d541887a901057">NonCopyable</a> (const <a class="el" href="class_non_copyable.html">NonCopyable</a> &amp;)=delete</td></tr>
  146. <tr class="separator:a501d34ffcc34b30de6d541887a901057 inherit pub_methods_class_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
  147. <tr class="memitem:aaf9b12dcaae80c9d304df7a941d4e21f inherit pub_methods_class_non_copyable" id="r_aaf9b12dcaae80c9d304df7a941d4e21f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_non_copyable.html#aaf9b12dcaae80c9d304df7a941d4e21f">operator=</a> (const <a class="el" href="class_non_copyable.html">NonCopyable</a> &amp;)=delete</td></tr>
  148. <tr class="separator:aaf9b12dcaae80c9d304df7a941d4e21f inherit pub_methods_class_non_copyable"><td class="memSeparator" colspan="2">&#160;</td></tr>
  149. </table>
  150. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  151. <div class="textblock"><p>Convex vs convex collision detection Based on: A Fast and Robust GJK Implementation for Collision Detection of Convex Objects - Gino van den Bergen </p>
  152. </div><h2 class="groupheader">Member Function Documentation</h2>
  153. <a id="ade3cde48252b6f77f749f9ac29685ec7" name="ade3cde48252b6f77f749f9ac29685ec7"></a>
  154. <h2 class="memtitle"><span class="permalink"><a href="#ade3cde48252b6f77f749f9ac29685ec7">&#9670;&#160;</a></span>CastRay()</h2>
  155. <div class="memitem">
  156. <div class="memproto">
  157. <div class="memtemplate">
  158. template&lt;typename A &gt; </div>
  159. <table class="mlabels">
  160. <tr>
  161. <td class="mlabels-left">
  162. <table class="memname">
  163. <tr>
  164. <td class="memname">bool GJKClosestPoint::CastRay </td>
  165. <td>(</td>
  166. <td class="paramtype"><a class="el" href="_math_types_8h.html#a6bc57c31f15cea47640b580d03737c68">Vec3Arg</a></td> <td class="paramname"><span class="paramname"><em>inRayOrigin</em></span>, </td>
  167. </tr>
  168. <tr>
  169. <td class="paramkey"></td>
  170. <td></td>
  171. <td class="paramtype"><a class="el" href="_math_types_8h.html#a6bc57c31f15cea47640b580d03737c68">Vec3Arg</a></td> <td class="paramname"><span class="paramname"><em>inRayDirection</em></span>, </td>
  172. </tr>
  173. <tr>
  174. <td class="paramkey"></td>
  175. <td></td>
  176. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  177. </tr>
  178. <tr>
  179. <td class="paramkey"></td>
  180. <td></td>
  181. <td class="paramtype">const A &amp;</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
  182. </tr>
  183. <tr>
  184. <td class="paramkey"></td>
  185. <td></td>
  186. <td class="paramtype">float &amp;</td> <td class="paramname"><span class="paramname"><em>ioLambda</em></span>&#160;)</td>
  187. </tr>
  188. </table>
  189. </td>
  190. <td class="mlabels-right">
  191. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  192. </tr>
  193. </table>
  194. </div><div class="memdoc">
  195. <p>Test if a ray inRayOrigin + lambda * inRayDirection for lambda e [0, ioLambda&gt; intersects inA</p>
  196. <p>Code based upon: Ray Casting against General Convex Objects with Application to Continuous Collision Detection - Gino van den Bergen</p>
  197. <dl class="params"><dt>Parameters</dt><dd>
  198. <table class="params">
  199. <tr><td class="paramname">inRayOrigin</td><td>Origin of the ray </td></tr>
  200. <tr><td class="paramname">inRayDirection</td><td>Direction of the ray (ioLambda * inDirection determines length) </td></tr>
  201. <tr><td class="paramname">inTolerance</td><td>The minimal distance between the ray and A before it is considered colliding </td></tr>
  202. <tr><td class="paramname">inA</td><td>A convex object that has the GetSupport(Vec3) function </td></tr>
  203. <tr><td class="paramname">ioLambda</td><td>The max fraction along the ray, on output updated with the actual collision fraction.</td></tr>
  204. </table>
  205. </dd>
  206. </dl>
  207. <dl class="section return"><dt>Returns</dt><dd>true if a hit was found, ioLambda is the solution for lambda. </dd></dl>
  208. </div>
  209. </div>
  210. <a id="a66d20557ad6d34a1c1f29b6df058b523" name="a66d20557ad6d34a1c1f29b6df058b523"></a>
  211. <h2 class="memtitle"><span class="permalink"><a href="#a66d20557ad6d34a1c1f29b6df058b523">&#9670;&#160;</a></span>CastShape() <span class="overload">[1/2]</span></h2>
  212. <div class="memitem">
  213. <div class="memproto">
  214. <div class="memtemplate">
  215. template&lt;typename A , typename B &gt; </div>
  216. <table class="mlabels">
  217. <tr>
  218. <td class="mlabels-left">
  219. <table class="memname">
  220. <tr>
  221. <td class="memname">bool GJKClosestPoint::CastShape </td>
  222. <td>(</td>
  223. <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>
  224. </tr>
  225. <tr>
  226. <td class="paramkey"></td>
  227. <td></td>
  228. <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>
  229. </tr>
  230. <tr>
  231. <td class="paramkey"></td>
  232. <td></td>
  233. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  234. </tr>
  235. <tr>
  236. <td class="paramkey"></td>
  237. <td></td>
  238. <td class="paramtype">const A &amp;</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
  239. </tr>
  240. <tr>
  241. <td class="paramkey"></td>
  242. <td></td>
  243. <td class="paramtype">const B &amp;</td> <td class="paramname"><span class="paramname"><em>inB</em></span>, </td>
  244. </tr>
  245. <tr>
  246. <td class="paramkey"></td>
  247. <td></td>
  248. <td class="paramtype">float &amp;</td> <td class="paramname"><span class="paramname"><em>ioLambda</em></span>&#160;)</td>
  249. </tr>
  250. </table>
  251. </td>
  252. <td class="mlabels-right">
  253. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  254. </tr>
  255. </table>
  256. </div><div class="memdoc">
  257. <p>Test if a cast shape inA moving from inStart to lambda * inStart.GetTranslation() + inDirection where lambda e [0, ioLambda&gt; intersects inB</p>
  258. <dl class="params"><dt>Parameters</dt><dd>
  259. <table class="params">
  260. <tr><td class="paramname">inStart</td><td>Start position and orientation of the convex object </td></tr>
  261. <tr><td class="paramname">inDirection</td><td>Direction of the sweep (ioLambda * inDirection determines length) </td></tr>
  262. <tr><td class="paramname">inTolerance</td><td>The minimal distance between A and B before they are considered colliding </td></tr>
  263. <tr><td class="paramname">inA</td><td>The convex object A, must support the GetSupport(Vec3) function. </td></tr>
  264. <tr><td class="paramname">inB</td><td>The convex object B, must support the GetSupport(Vec3) function. </td></tr>
  265. <tr><td class="paramname">ioLambda</td><td>The max fraction along the sweep, on output updated with the actual collision fraction.</td></tr>
  266. </table>
  267. </dd>
  268. </dl>
  269. <dl class="section return"><dt>Returns</dt><dd>true if a hit was found, ioLambda is the solution for lambda. </dd></dl>
  270. </div>
  271. </div>
  272. <a id="aa5b19da7e23744cb5c1af8fe2fee2940" name="aa5b19da7e23744cb5c1af8fe2fee2940"></a>
  273. <h2 class="memtitle"><span class="permalink"><a href="#aa5b19da7e23744cb5c1af8fe2fee2940">&#9670;&#160;</a></span>CastShape() <span class="overload">[2/2]</span></h2>
  274. <div class="memitem">
  275. <div class="memproto">
  276. <div class="memtemplate">
  277. template&lt;typename A , typename B &gt; </div>
  278. <table class="mlabels">
  279. <tr>
  280. <td class="mlabels-left">
  281. <table class="memname">
  282. <tr>
  283. <td class="memname">bool GJKClosestPoint::CastShape </td>
  284. <td>(</td>
  285. <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>
  286. </tr>
  287. <tr>
  288. <td class="paramkey"></td>
  289. <td></td>
  290. <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>
  291. </tr>
  292. <tr>
  293. <td class="paramkey"></td>
  294. <td></td>
  295. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  296. </tr>
  297. <tr>
  298. <td class="paramkey"></td>
  299. <td></td>
  300. <td class="paramtype">const A &amp;</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
  301. </tr>
  302. <tr>
  303. <td class="paramkey"></td>
  304. <td></td>
  305. <td class="paramtype">const B &amp;</td> <td class="paramname"><span class="paramname"><em>inB</em></span>, </td>
  306. </tr>
  307. <tr>
  308. <td class="paramkey"></td>
  309. <td></td>
  310. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusA</em></span>, </td>
  311. </tr>
  312. <tr>
  313. <td class="paramkey"></td>
  314. <td></td>
  315. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inConvexRadiusB</em></span>, </td>
  316. </tr>
  317. <tr>
  318. <td class="paramkey"></td>
  319. <td></td>
  320. <td class="paramtype">float &amp;</td> <td class="paramname"><span class="paramname"><em>ioLambda</em></span>, </td>
  321. </tr>
  322. <tr>
  323. <td class="paramkey"></td>
  324. <td></td>
  325. <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>
  326. </tr>
  327. <tr>
  328. <td class="paramkey"></td>
  329. <td></td>
  330. <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>
  331. </tr>
  332. <tr>
  333. <td class="paramkey"></td>
  334. <td></td>
  335. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outSeparatingAxis</em></span>&#160;)</td>
  336. </tr>
  337. </table>
  338. </td>
  339. <td class="mlabels-right">
  340. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  341. </tr>
  342. </table>
  343. </div><div class="memdoc">
  344. <p>Test if a cast shape inA moving from inStart to lambda * inStart.GetTranslation() + inDirection where lambda e [0, ioLambda&gt; intersects inB</p>
  345. <dl class="params"><dt>Parameters</dt><dd>
  346. <table class="params">
  347. <tr><td class="paramname">inStart</td><td>Start position and orientation of the convex object </td></tr>
  348. <tr><td class="paramname">inDirection</td><td>Direction of the sweep (ioLambda * inDirection determines length) </td></tr>
  349. <tr><td class="paramname">inTolerance</td><td>The minimal distance between A and B before they are considered colliding </td></tr>
  350. <tr><td class="paramname">inA</td><td>The convex object A, must support the GetSupport(Vec3) function. </td></tr>
  351. <tr><td class="paramname">inB</td><td>The convex object B, must support the GetSupport(Vec3) function. </td></tr>
  352. <tr><td class="paramname">inConvexRadiusA</td><td>The convex radius of A, this will be added on all sides to pad A. </td></tr>
  353. <tr><td class="paramname">inConvexRadiusB</td><td>The convex radius of B, this will be added on all sides to pad B. </td></tr>
  354. <tr><td class="paramname">ioLambda</td><td>The max fraction along the sweep, on output updated with the actual collision fraction. </td></tr>
  355. <tr><td class="paramname">outPointA</td><td>is the contact point on A (if outSeparatingAxis is near zero, this may not be not the deepest point) </td></tr>
  356. <tr><td class="paramname">outPointB</td><td>is the contact point on B (if outSeparatingAxis is near zero, this may not be not the deepest point) </td></tr>
  357. <tr><td class="paramname">outSeparatingAxis</td><td>On return this will contain a vector that points from A to B along the smallest distance of separation. The length of this vector indicates the separation of A and B without their convex radius. If it is near zero, the direction may not be accurate as the bodies may overlap when lambda = 0.</td></tr>
  358. </table>
  359. </dd>
  360. </dl>
  361. <dl class="section return"><dt>Returns</dt><dd>true if a hit was found, ioLambda is the solution for lambda and outPoint and outSeparatingAxis are valid. </dd></dl>
  362. </div>
  363. </div>
  364. <a id="abb7cfdd49d708007d75b4c2e9b90ebb9" name="abb7cfdd49d708007d75b4c2e9b90ebb9"></a>
  365. <h2 class="memtitle"><span class="permalink"><a href="#abb7cfdd49d708007d75b4c2e9b90ebb9">&#9670;&#160;</a></span>GetClosestPoints()</h2>
  366. <div class="memitem">
  367. <div class="memproto">
  368. <div class="memtemplate">
  369. template&lt;typename A , typename B &gt; </div>
  370. <table class="mlabels">
  371. <tr>
  372. <td class="mlabels-left">
  373. <table class="memname">
  374. <tr>
  375. <td class="memname">float GJKClosestPoint::GetClosestPoints </td>
  376. <td>(</td>
  377. <td class="paramtype">const A &amp;</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
  378. </tr>
  379. <tr>
  380. <td class="paramkey"></td>
  381. <td></td>
  382. <td class="paramtype">const B &amp;</td> <td class="paramname"><span class="paramname"><em>inB</em></span>, </td>
  383. </tr>
  384. <tr>
  385. <td class="paramkey"></td>
  386. <td></td>
  387. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  388. </tr>
  389. <tr>
  390. <td class="paramkey"></td>
  391. <td></td>
  392. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inMaxDistSq</em></span>, </td>
  393. </tr>
  394. <tr>
  395. <td class="paramkey"></td>
  396. <td></td>
  397. <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>
  398. </tr>
  399. <tr>
  400. <td class="paramkey"></td>
  401. <td></td>
  402. <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>
  403. </tr>
  404. <tr>
  405. <td class="paramkey"></td>
  406. <td></td>
  407. <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>
  408. </tr>
  409. </table>
  410. </td>
  411. <td class="mlabels-right">
  412. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  413. </tr>
  414. </table>
  415. </div><div class="memdoc">
  416. <p>Get closest points between inA and inB</p>
  417. <dl class="params"><dt>Parameters</dt><dd>
  418. <table class="params">
  419. <tr><td class="paramname">inA</td><td>The convex object A, must support the GetSupport(Vec3) function. </td></tr>
  420. <tr><td class="paramname">inB</td><td>The convex object B, must support the GetSupport(Vec3) function. </td></tr>
  421. <tr><td class="paramname">inTolerance</td><td>The minimal distance between A and B before the objects are considered colliding and processing is terminated. </td></tr>
  422. <tr><td class="paramname">inMaxDistSq</td><td>The maximum squared distance between A and B before the objects are considered infinitely far away and processing is terminated. </td></tr>
  423. <tr><td class="paramname">ioV</td><td>Initial guess for the separating axis. Start with any non-zero vector if you don't know. If return value is 0, ioV = (0, 0, 0). If the return value is bigger than 0 but smaller than FLT_MAX, ioV will be the separating axis in the direction from A to B and its length the squared distance between A and B. If the return value is FLT_MAX, ioV will be the separating axis in the direction from A to B and the magnitude of the vector is meaningless. </td></tr>
  424. <tr><td class="paramname">outPointA,outPointB</td><td>If the return value is 0 the points are invalid. If the return value is bigger than 0 but smaller than FLT_MAX these will contain the closest point on A and B. If the return value is FLT_MAX the points are invalid.</td></tr>
  425. </table>
  426. </dd>
  427. </dl>
  428. <dl class="section return"><dt>Returns</dt><dd>The squared distance between A and B or FLT_MAX when they are further away than inMaxDistSq. </dd></dl>
  429. </div>
  430. </div>
  431. <a id="a73d6f276fb275026a0126ca7361fb2bf" name="a73d6f276fb275026a0126ca7361fb2bf"></a>
  432. <h2 class="memtitle"><span class="permalink"><a href="#a73d6f276fb275026a0126ca7361fb2bf">&#9670;&#160;</a></span>GetClosestPointsSimplex()</h2>
  433. <div class="memitem">
  434. <div class="memproto">
  435. <table class="mlabels">
  436. <tr>
  437. <td class="mlabels-left">
  438. <table class="memname">
  439. <tr>
  440. <td class="memname">void GJKClosestPoint::GetClosestPointsSimplex </td>
  441. <td>(</td>
  442. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> *</td> <td class="paramname"><span class="paramname"><em>outY</em></span>, </td>
  443. </tr>
  444. <tr>
  445. <td class="paramkey"></td>
  446. <td></td>
  447. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> *</td> <td class="paramname"><span class="paramname"><em>outP</em></span>, </td>
  448. </tr>
  449. <tr>
  450. <td class="paramkey"></td>
  451. <td></td>
  452. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> *</td> <td class="paramname"><span class="paramname"><em>outQ</em></span>, </td>
  453. </tr>
  454. <tr>
  455. <td class="paramkey"></td>
  456. <td></td>
  457. <td class="paramtype"><a class="el" href="_core_8h.html#a69aa29b598b851b0640aa225a9e5d61d">uint</a> &amp;</td> <td class="paramname"><span class="paramname"><em>outNumPoints</em></span>&#160;) const</td>
  458. </tr>
  459. </table>
  460. </td>
  461. <td class="mlabels-right">
  462. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  463. </tr>
  464. </table>
  465. </div><div class="memdoc">
  466. <p>Get the resulting simplex after the GetClosestPoints algorithm finishes. If it returned a squared distance of 0, the origin will be contained in the simplex. </p>
  467. </div>
  468. </div>
  469. <a id="a20ab4d36efcf62ceae244ec75eb4bc23" name="a20ab4d36efcf62ceae244ec75eb4bc23"></a>
  470. <h2 class="memtitle"><span class="permalink"><a href="#a20ab4d36efcf62ceae244ec75eb4bc23">&#9670;&#160;</a></span>Intersects()</h2>
  471. <div class="memitem">
  472. <div class="memproto">
  473. <div class="memtemplate">
  474. template&lt;typename A , typename B &gt; </div>
  475. <table class="mlabels">
  476. <tr>
  477. <td class="mlabels-left">
  478. <table class="memname">
  479. <tr>
  480. <td class="memname">bool GJKClosestPoint::Intersects </td>
  481. <td>(</td>
  482. <td class="paramtype">const A &amp;</td> <td class="paramname"><span class="paramname"><em>inA</em></span>, </td>
  483. </tr>
  484. <tr>
  485. <td class="paramkey"></td>
  486. <td></td>
  487. <td class="paramtype">const B &amp;</td> <td class="paramname"><span class="paramname"><em>inB</em></span>, </td>
  488. </tr>
  489. <tr>
  490. <td class="paramkey"></td>
  491. <td></td>
  492. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inTolerance</em></span>, </td>
  493. </tr>
  494. <tr>
  495. <td class="paramkey"></td>
  496. <td></td>
  497. <td class="paramtype"><a class="el" href="class_vec3.html">Vec3</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioV</em></span>&#160;)</td>
  498. </tr>
  499. </table>
  500. </td>
  501. <td class="mlabels-right">
  502. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  503. </tr>
  504. </table>
  505. </div><div class="memdoc">
  506. <p>Test if inA and inB intersect</p>
  507. <dl class="params"><dt>Parameters</dt><dd>
  508. <table class="params">
  509. <tr><td class="paramname">inA</td><td>The convex object A, must support the GetSupport(Vec3) function. </td></tr>
  510. <tr><td class="paramname">inB</td><td>The convex object B, must support the GetSupport(Vec3) function. </td></tr>
  511. <tr><td class="paramname">inTolerance</td><td>Minimal distance between objects when the objects are considered to be colliding </td></tr>
  512. <tr><td class="paramname">ioV</td><td>is used as initial separating axis (provide a zero vector if you don't know yet)</td></tr>
  513. </table>
  514. </dd>
  515. </dl>
  516. <dl class="section return"><dt>Returns</dt><dd>True if they intersect (in which case ioV = (0, 0, 0)). False if they don't intersect in which case ioV is a separating axis in the direction from A to B (magnitude is meaningless) </dd></dl>
  517. </div>
  518. </div>
  519. <hr/>The documentation for this class was generated from the following file:<ul>
  520. <li>Jolt/Geometry/<a class="el" href="_g_j_k_closest_point_8h_source.html">GJKClosestPoint.h</a></li>
  521. </ul>
  522. </div><!-- contents -->
  523. </div><!-- doc-content -->
  524. <!-- start footer part -->
  525. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  526. <ul>
  527. <li class="navelem"><a class="el" href="class_g_j_k_closest_point.html">GJKClosestPoint</a></li>
  528. <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>
  529. </ul>
  530. </div>
  531. </body>
  532. </html>