Platformer in OpenGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

441 lines
19 KiB

5 years ago
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.14"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>0.9.9 API documenation: GLM_GTX_intersect</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. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
  24. <td id="projectalign" style="padding-left: 0.5em;">
  25. <div id="projectname">0.9.9 API documenation
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.14 -->
  34. <script type="text/javascript">
  35. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. /* @license-end */
  38. </script>
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  43. $(function() {
  44. initMenu('',true,false,'search.php','Search');
  45. $(document).ready(function() { init_search(); });
  46. });
  47. /* @license-end */</script>
  48. <div id="main-nav"></div>
  49. </div><!-- top -->
  50. <!-- window showing the filter options -->
  51. <div id="MSearchSelectWindow"
  52. onmouseover="return searchBox.OnSearchSelectShow()"
  53. onmouseout="return searchBox.OnSearchSelectHide()"
  54. onkeydown="return searchBox.OnSearchSelectKey(event)">
  55. </div>
  56. <!-- iframe showing the search results (closed by default) -->
  57. <div id="MSearchResultsWindow">
  58. <iframe src="javascript:void(0)" frameborder="0"
  59. name="MSearchResults" id="MSearchResults">
  60. </iframe>
  61. </div>
  62. <div class="header">
  63. <div class="summary">
  64. <a href="#func-members">Functions</a> </div>
  65. <div class="headertitle">
  66. <div class="title">GLM_GTX_intersect<div class="ingroups"><a class="el" href="a00705.html">Experimental extensions</a></div></div> </div>
  67. </div><!--header-->
  68. <div class="contents">
  69. <table class="memberdecls">
  70. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  71. Functions</h2></td></tr>
  72. <tr class="memitem:ga9c68139f3d8a4f3d7fe45f9dbc0de5b7"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  73. <tr class="memitem:ga9c68139f3d8a4f3d7fe45f9dbc0de5b7"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00748.html#ga9c68139f3d8a4f3d7fe45f9dbc0de5b7">intersectLineSphere</a> (genType const &amp;point0, genType const &amp;point1, genType const &amp;sphereCenter, typename genType::value_type sphereRadius, genType &amp;intersectionPosition1, genType &amp;intersectionNormal1, genType &amp;intersectionPosition2=genType(), genType &amp;intersectionNormal2=genType())</td></tr>
  74. <tr class="separator:ga9c68139f3d8a4f3d7fe45f9dbc0de5b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. <tr class="memitem:ga9d29b9b3acb504d43986502f42740df4"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  76. <tr class="memitem:ga9d29b9b3acb504d43986502f42740df4"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00748.html#ga9d29b9b3acb504d43986502f42740df4">intersectLineTriangle</a> (genType const &amp;orig, genType const &amp;dir, genType const &amp;vert0, genType const &amp;vert1, genType const &amp;vert2, genType &amp;position)</td></tr>
  77. <tr class="separator:ga9d29b9b3acb504d43986502f42740df4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  78. <tr class="memitem:gad3697a9700ea379739a667ea02573488"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  79. <tr class="memitem:gad3697a9700ea379739a667ea02573488"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00748.html#gad3697a9700ea379739a667ea02573488">intersectRayPlane</a> (genType const &amp;orig, genType const &amp;dir, genType const &amp;planeOrig, genType const &amp;planeNormal, typename genType::value_type &amp;intersectionDistance)</td></tr>
  80. <tr class="separator:gad3697a9700ea379739a667ea02573488"><td class="memSeparator" colspan="2">&#160;</td></tr>
  81. <tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  82. <tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00748.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">intersectRaySphere</a> (genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type &amp;intersectionDistance)</td></tr>
  83. <tr class="separator:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  84. <tr class="memitem:gad28c00515b823b579c608aafa1100c1d"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  85. <tr class="memitem:gad28c00515b823b579c608aafa1100c1d"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00748.html#gad28c00515b823b579c608aafa1100c1d">intersectRaySphere</a> (genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, const typename genType::value_type sphereRadius, genType &amp;intersectionPosition, genType &amp;intersectionNormal)</td></tr>
  86. <tr class="separator:gad28c00515b823b579c608aafa1100c1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  87. <tr class="memitem:ga65bf2c594482f04881c36bc761f9e946"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  88. <tr class="memitem:ga65bf2c594482f04881c36bc761f9e946"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00748.html#ga65bf2c594482f04881c36bc761f9e946">intersectRayTriangle</a> (vec&lt; 3, T, Q &gt; const &amp;orig, vec&lt; 3, T, Q &gt; const &amp;dir, vec&lt; 3, T, Q &gt; const &amp;v0, vec&lt; 3, T, Q &gt; const &amp;v1, vec&lt; 3, T, Q &gt; const &amp;v2, vec&lt; 2, T, Q &gt; &amp;baryPosition, T &amp;distance)</td></tr>
  89. <tr class="separator:ga65bf2c594482f04881c36bc761f9e946"><td class="memSeparator" colspan="2">&#160;</td></tr>
  90. </table>
  91. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  92. <p>Include &lt;<a class="el" href="a00506.html" title="GLM_GTX_intersect ">glm/gtx/intersect.hpp</a>&gt; to use the features of this extension. </p>
  93. <p>Add intersection functions </p>
  94. <h2 class="groupheader">Function Documentation</h2>
  95. <a id="ga9c68139f3d8a4f3d7fe45f9dbc0de5b7"></a>
  96. <h2 class="memtitle"><span class="permalink"><a href="#ga9c68139f3d8a4f3d7fe45f9dbc0de5b7">&#9670;&nbsp;</a></span>intersectLineSphere()</h2>
  97. <div class="memitem">
  98. <div class="memproto">
  99. <table class="memname">
  100. <tr>
  101. <td class="memname">GLM_FUNC_DECL bool glm::intersectLineSphere </td>
  102. <td>(</td>
  103. <td class="paramtype">genType const &amp;&#160;</td>
  104. <td class="paramname"><em>point0</em>, </td>
  105. </tr>
  106. <tr>
  107. <td class="paramkey"></td>
  108. <td></td>
  109. <td class="paramtype">genType const &amp;&#160;</td>
  110. <td class="paramname"><em>point1</em>, </td>
  111. </tr>
  112. <tr>
  113. <td class="paramkey"></td>
  114. <td></td>
  115. <td class="paramtype">genType const &amp;&#160;</td>
  116. <td class="paramname"><em>sphereCenter</em>, </td>
  117. </tr>
  118. <tr>
  119. <td class="paramkey"></td>
  120. <td></td>
  121. <td class="paramtype">typename genType::value_type&#160;</td>
  122. <td class="paramname"><em>sphereRadius</em>, </td>
  123. </tr>
  124. <tr>
  125. <td class="paramkey"></td>
  126. <td></td>
  127. <td class="paramtype">genType &amp;&#160;</td>
  128. <td class="paramname"><em>intersectionPosition1</em>, </td>
  129. </tr>
  130. <tr>
  131. <td class="paramkey"></td>
  132. <td></td>
  133. <td class="paramtype">genType &amp;&#160;</td>
  134. <td class="paramname"><em>intersectionNormal1</em>, </td>
  135. </tr>
  136. <tr>
  137. <td class="paramkey"></td>
  138. <td></td>
  139. <td class="paramtype">genType &amp;&#160;</td>
  140. <td class="paramname"><em>intersectionPosition2</em> = <code>genType()</code>, </td>
  141. </tr>
  142. <tr>
  143. <td class="paramkey"></td>
  144. <td></td>
  145. <td class="paramtype">genType &amp;&#160;</td>
  146. <td class="paramname"><em>intersectionNormal2</em> = <code>genType()</code>&#160;</td>
  147. </tr>
  148. <tr>
  149. <td></td>
  150. <td>)</td>
  151. <td></td><td></td>
  152. </tr>
  153. </table>
  154. </div><div class="memdoc">
  155. <p>Compute the intersection of a line and a sphere. </p>
  156. <p>From GLM_GTX_intersect extension </p>
  157. </div>
  158. </div>
  159. <a id="ga9d29b9b3acb504d43986502f42740df4"></a>
  160. <h2 class="memtitle"><span class="permalink"><a href="#ga9d29b9b3acb504d43986502f42740df4">&#9670;&nbsp;</a></span>intersectLineTriangle()</h2>
  161. <div class="memitem">
  162. <div class="memproto">
  163. <table class="memname">
  164. <tr>
  165. <td class="memname">GLM_FUNC_DECL bool glm::intersectLineTriangle </td>
  166. <td>(</td>
  167. <td class="paramtype">genType const &amp;&#160;</td>
  168. <td class="paramname"><em>orig</em>, </td>
  169. </tr>
  170. <tr>
  171. <td class="paramkey"></td>
  172. <td></td>
  173. <td class="paramtype">genType const &amp;&#160;</td>
  174. <td class="paramname"><em>dir</em>, </td>
  175. </tr>
  176. <tr>
  177. <td class="paramkey"></td>
  178. <td></td>
  179. <td class="paramtype">genType const &amp;&#160;</td>
  180. <td class="paramname"><em>vert0</em>, </td>
  181. </tr>
  182. <tr>
  183. <td class="paramkey"></td>
  184. <td></td>
  185. <td class="paramtype">genType const &amp;&#160;</td>
  186. <td class="paramname"><em>vert1</em>, </td>
  187. </tr>
  188. <tr>
  189. <td class="paramkey"></td>
  190. <td></td>
  191. <td class="paramtype">genType const &amp;&#160;</td>
  192. <td class="paramname"><em>vert2</em>, </td>
  193. </tr>
  194. <tr>
  195. <td class="paramkey"></td>
  196. <td></td>
  197. <td class="paramtype">genType &amp;&#160;</td>
  198. <td class="paramname"><em>position</em>&#160;</td>
  199. </tr>
  200. <tr>
  201. <td></td>
  202. <td>)</td>
  203. <td></td><td></td>
  204. </tr>
  205. </table>
  206. </div><div class="memdoc">
  207. <p>Compute the intersection of a line and a triangle. </p>
  208. <p>From GLM_GTX_intersect extension. </p>
  209. </div>
  210. </div>
  211. <a id="gad3697a9700ea379739a667ea02573488"></a>
  212. <h2 class="memtitle"><span class="permalink"><a href="#gad3697a9700ea379739a667ea02573488">&#9670;&nbsp;</a></span>intersectRayPlane()</h2>
  213. <div class="memitem">
  214. <div class="memproto">
  215. <table class="memname">
  216. <tr>
  217. <td class="memname">GLM_FUNC_DECL bool glm::intersectRayPlane </td>
  218. <td>(</td>
  219. <td class="paramtype">genType const &amp;&#160;</td>
  220. <td class="paramname"><em>orig</em>, </td>
  221. </tr>
  222. <tr>
  223. <td class="paramkey"></td>
  224. <td></td>
  225. <td class="paramtype">genType const &amp;&#160;</td>
  226. <td class="paramname"><em>dir</em>, </td>
  227. </tr>
  228. <tr>
  229. <td class="paramkey"></td>
  230. <td></td>
  231. <td class="paramtype">genType const &amp;&#160;</td>
  232. <td class="paramname"><em>planeOrig</em>, </td>
  233. </tr>
  234. <tr>
  235. <td class="paramkey"></td>
  236. <td></td>
  237. <td class="paramtype">genType const &amp;&#160;</td>
  238. <td class="paramname"><em>planeNormal</em>, </td>
  239. </tr>
  240. <tr>
  241. <td class="paramkey"></td>
  242. <td></td>
  243. <td class="paramtype">typename genType::value_type &amp;&#160;</td>
  244. <td class="paramname"><em>intersectionDistance</em>&#160;</td>
  245. </tr>
  246. <tr>
  247. <td></td>
  248. <td>)</td>
  249. <td></td><td></td>
  250. </tr>
  251. </table>
  252. </div><div class="memdoc">
  253. <p>Compute the intersection of a ray and a plane. </p>
  254. <p>Ray direction and plane normal must be unit length. From GLM_GTX_intersect extension. </p>
  255. </div>
  256. </div>
  257. <a id="gac88f8cd84c4bcb5b947d56acbbcfa56e"></a>
  258. <h2 class="memtitle"><span class="permalink"><a href="#gac88f8cd84c4bcb5b947d56acbbcfa56e">&#9670;&nbsp;</a></span>intersectRaySphere() <span class="overload">[1/2]</span></h2>
  259. <div class="memitem">
  260. <div class="memproto">
  261. <table class="memname">
  262. <tr>
  263. <td class="memname">GLM_FUNC_DECL bool glm::intersectRaySphere </td>
  264. <td>(</td>
  265. <td class="paramtype">genType const &amp;&#160;</td>
  266. <td class="paramname"><em>rayStarting</em>, </td>
  267. </tr>
  268. <tr>
  269. <td class="paramkey"></td>
  270. <td></td>
  271. <td class="paramtype">genType const &amp;&#160;</td>
  272. <td class="paramname"><em>rayNormalizedDirection</em>, </td>
  273. </tr>
  274. <tr>
  275. <td class="paramkey"></td>
  276. <td></td>
  277. <td class="paramtype">genType const &amp;&#160;</td>
  278. <td class="paramname"><em>sphereCenter</em>, </td>
  279. </tr>
  280. <tr>
  281. <td class="paramkey"></td>
  282. <td></td>
  283. <td class="paramtype">typename genType::value_type const&#160;</td>
  284. <td class="paramname"><em>sphereRadiusSquered</em>, </td>
  285. </tr>
  286. <tr>
  287. <td class="paramkey"></td>
  288. <td></td>
  289. <td class="paramtype">typename genType::value_type &amp;&#160;</td>
  290. <td class="paramname"><em>intersectionDistance</em>&#160;</td>
  291. </tr>
  292. <tr>
  293. <td></td>
  294. <td>)</td>
  295. <td></td><td></td>
  296. </tr>
  297. </table>
  298. </div><div class="memdoc">
  299. <p>Compute the intersection distance of a ray and a sphere. </p>
  300. <p>The ray direction vector is unit length. From GLM_GTX_intersect extension. </p>
  301. </div>
  302. </div>
  303. <a id="gad28c00515b823b579c608aafa1100c1d"></a>
  304. <h2 class="memtitle"><span class="permalink"><a href="#gad28c00515b823b579c608aafa1100c1d">&#9670;&nbsp;</a></span>intersectRaySphere() <span class="overload">[2/2]</span></h2>
  305. <div class="memitem">
  306. <div class="memproto">
  307. <table class="memname">
  308. <tr>
  309. <td class="memname">GLM_FUNC_DECL bool glm::intersectRaySphere </td>
  310. <td>(</td>
  311. <td class="paramtype">genType const &amp;&#160;</td>
  312. <td class="paramname"><em>rayStarting</em>, </td>
  313. </tr>
  314. <tr>
  315. <td class="paramkey"></td>
  316. <td></td>
  317. <td class="paramtype">genType const &amp;&#160;</td>
  318. <td class="paramname"><em>rayNormalizedDirection</em>, </td>
  319. </tr>
  320. <tr>
  321. <td class="paramkey"></td>
  322. <td></td>
  323. <td class="paramtype">genType const &amp;&#160;</td>
  324. <td class="paramname"><em>sphereCenter</em>, </td>
  325. </tr>
  326. <tr>
  327. <td class="paramkey"></td>
  328. <td></td>
  329. <td class="paramtype">const typename genType::value_type&#160;</td>
  330. <td class="paramname"><em>sphereRadius</em>, </td>
  331. </tr>
  332. <tr>
  333. <td class="paramkey"></td>
  334. <td></td>
  335. <td class="paramtype">genType &amp;&#160;</td>
  336. <td class="paramname"><em>intersectionPosition</em>, </td>
  337. </tr>
  338. <tr>
  339. <td class="paramkey"></td>
  340. <td></td>
  341. <td class="paramtype">genType &amp;&#160;</td>
  342. <td class="paramname"><em>intersectionNormal</em>&#160;</td>
  343. </tr>
  344. <tr>
  345. <td></td>
  346. <td>)</td>
  347. <td></td><td></td>
  348. </tr>
  349. </table>
  350. </div><div class="memdoc">
  351. <p>Compute the intersection of a ray and a sphere. </p>
  352. <p>From GLM_GTX_intersect extension. </p>
  353. </div>
  354. </div>
  355. <a id="ga65bf2c594482f04881c36bc761f9e946"></a>
  356. <h2 class="memtitle"><span class="permalink"><a href="#ga65bf2c594482f04881c36bc761f9e946">&#9670;&nbsp;</a></span>intersectRayTriangle()</h2>
  357. <div class="memitem">
  358. <div class="memproto">
  359. <table class="memname">
  360. <tr>
  361. <td class="memname">GLM_FUNC_DECL bool glm::intersectRayTriangle </td>
  362. <td>(</td>
  363. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  364. <td class="paramname"><em>orig</em>, </td>
  365. </tr>
  366. <tr>
  367. <td class="paramkey"></td>
  368. <td></td>
  369. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  370. <td class="paramname"><em>dir</em>, </td>
  371. </tr>
  372. <tr>
  373. <td class="paramkey"></td>
  374. <td></td>
  375. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  376. <td class="paramname"><em>v0</em>, </td>
  377. </tr>
  378. <tr>
  379. <td class="paramkey"></td>
  380. <td></td>
  381. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  382. <td class="paramname"><em>v1</em>, </td>
  383. </tr>
  384. <tr>
  385. <td class="paramkey"></td>
  386. <td></td>
  387. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  388. <td class="paramname"><em>v2</em>, </td>
  389. </tr>
  390. <tr>
  391. <td class="paramkey"></td>
  392. <td></td>
  393. <td class="paramtype">vec&lt; 2, T, Q &gt; &amp;&#160;</td>
  394. <td class="paramname"><em>baryPosition</em>, </td>
  395. </tr>
  396. <tr>
  397. <td class="paramkey"></td>
  398. <td></td>
  399. <td class="paramtype">T &amp;&#160;</td>
  400. <td class="paramname"><em>distance</em>&#160;</td>
  401. </tr>
  402. <tr>
  403. <td></td>
  404. <td>)</td>
  405. <td></td><td></td>
  406. </tr>
  407. </table>
  408. </div><div class="memdoc">
  409. <p>Compute the intersection of a ray and a triangle. </p>
  410. <p>Based om Tomas Möller implementation <a href="http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/">http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/</a> From GLM_GTX_intersect extension. </p>
  411. </div>
  412. </div>
  413. </div><!-- contents -->
  414. <!-- start footer part -->
  415. <hr class="footer"/><address class="footer"><small>
  416. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  417. <img class="footer" src="doxygen.png" alt="doxygen"/>
  418. </a> 1.8.14
  419. </small></address>
  420. </body>
  421. </html>