Platformer in OpenGL
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

425 рядки
22 KiB

5 роки тому
  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_EXT_matrix_transform</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_EXT_matrix_transform<div class="ingroups"><a class="el" href="a00703.html">Stable 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:ga81696f2b8d1db02ea1aff8da8f269314"><td class="memTemplParams" colspan="2"><a id="ga81696f2b8d1db02ea1aff8da8f269314"></a>
  73. template&lt;typename genType &gt; </td></tr>
  74. <tr class="memitem:ga81696f2b8d1db02ea1aff8da8f269314"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL GLM_CONSTEXPR genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#ga81696f2b8d1db02ea1aff8da8f269314">identity</a> ()</td></tr>
  75. <tr class="separator:ga81696f2b8d1db02ea1aff8da8f269314"><td class="memSeparator" colspan="2">&#160;</td></tr>
  76. <tr class="memitem:gaa64aa951a0e99136bba9008d2b59c78e"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  77. <tr class="memitem:gaa64aa951a0e99136bba9008d2b59c78e"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL mat&lt; 4, 4, T, Q &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#gaa64aa951a0e99136bba9008d2b59c78e">lookAt</a> (vec&lt; 3, T, Q &gt; const &amp;eye, vec&lt; 3, T, Q &gt; const &amp;center, vec&lt; 3, T, Q &gt; const &amp;up)</td></tr>
  78. <tr class="separator:gaa64aa951a0e99136bba9008d2b59c78e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  79. <tr class="memitem:gab2c09e25b0a16d3a9d89cc85bbae41b0"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  80. <tr class="memitem:gab2c09e25b0a16d3a9d89cc85bbae41b0"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL mat&lt; 4, 4, T, Q &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#gab2c09e25b0a16d3a9d89cc85bbae41b0">lookAtLH</a> (vec&lt; 3, T, Q &gt; const &amp;eye, vec&lt; 3, T, Q &gt; const &amp;center, vec&lt; 3, T, Q &gt; const &amp;up)</td></tr>
  81. <tr class="separator:gab2c09e25b0a16d3a9d89cc85bbae41b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  82. <tr class="memitem:gacfa12c8889c754846bc20c65d9b5c701"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  83. <tr class="memitem:gacfa12c8889c754846bc20c65d9b5c701"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL mat&lt; 4, 4, T, Q &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#gacfa12c8889c754846bc20c65d9b5c701">lookAtRH</a> (vec&lt; 3, T, Q &gt; const &amp;eye, vec&lt; 3, T, Q &gt; const &amp;center, vec&lt; 3, T, Q &gt; const &amp;up)</td></tr>
  84. <tr class="separator:gacfa12c8889c754846bc20c65d9b5c701"><td class="memSeparator" colspan="2">&#160;</td></tr>
  85. <tr class="memitem:gaee9e865eaa9776370996da2940873fd4"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  86. <tr class="memitem:gaee9e865eaa9776370996da2940873fd4"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL mat&lt; 4, 4, T, Q &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#gaee9e865eaa9776370996da2940873fd4">rotate</a> (mat&lt; 4, 4, T, Q &gt; const &amp;m, T angle, vec&lt; 3, T, Q &gt; const &amp;axis)</td></tr>
  87. <tr class="separator:gaee9e865eaa9776370996da2940873fd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  88. <tr class="memitem:ga05051adbee603fb3c5095d8cf5cc229b"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  89. <tr class="memitem:ga05051adbee603fb3c5095d8cf5cc229b"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL mat&lt; 4, 4, T, Q &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#ga05051adbee603fb3c5095d8cf5cc229b">scale</a> (mat&lt; 4, 4, T, Q &gt; const &amp;m, vec&lt; 3, T, Q &gt; const &amp;v)</td></tr>
  90. <tr class="separator:ga05051adbee603fb3c5095d8cf5cc229b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  91. <tr class="memitem:ga1a4ecc4ad82652b8fb14dcb087879284"><td class="memTemplParams" colspan="2">template&lt;typename T , qualifier Q&gt; </td></tr>
  92. <tr class="memitem:ga1a4ecc4ad82652b8fb14dcb087879284"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL mat&lt; 4, 4, T, Q &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00668.html#ga1a4ecc4ad82652b8fb14dcb087879284">translate</a> (mat&lt; 4, 4, T, Q &gt; const &amp;m, vec&lt; 3, T, Q &gt; const &amp;v)</td></tr>
  93. <tr class="separator:ga1a4ecc4ad82652b8fb14dcb087879284"><td class="memSeparator" colspan="2">&#160;</td></tr>
  94. </table>
  95. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  96. <p>Defines functions that generate common transformation matrices. </p>
  97. <p>The matrices generated by this extension use standard OpenGL fixed-function conventions. For example, the lookAt function generates a transform from world space into the specific eye space that the projective matrix functions (perspective, ortho, etc) are designed to expect. The OpenGL compatibility specifications defines the particular layout of this eye space.</p>
  98. <p>Include &lt;<a class="el" href="a01361.html" title="GLM_EXT_matrix_transform ">glm/ext/matrix_transform.hpp</a>&gt; to use the features of this extension.</p>
  99. <dl class="section see"><dt>See also</dt><dd><a class="el" href="a00666.html" title="Functions that generate common projection transformation matrices. ">GLM_EXT_matrix_projection</a> </dd>
  100. <dd>
  101. <a class="el" href="a00665.html" title="Defines functions that generate common transformation matrices. ">GLM_EXT_matrix_clip_space</a> </dd></dl>
  102. <h2 class="groupheader">Function Documentation</h2>
  103. <a id="gaa64aa951a0e99136bba9008d2b59c78e"></a>
  104. <h2 class="memtitle"><span class="permalink"><a href="#gaa64aa951a0e99136bba9008d2b59c78e">&#9670;&nbsp;</a></span>lookAt()</h2>
  105. <div class="memitem">
  106. <div class="memproto">
  107. <table class="memname">
  108. <tr>
  109. <td class="memname">GLM_FUNC_DECL mat&lt;4, 4, T, Q&gt; glm::lookAt </td>
  110. <td>(</td>
  111. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  112. <td class="paramname"><em>eye</em>, </td>
  113. </tr>
  114. <tr>
  115. <td class="paramkey"></td>
  116. <td></td>
  117. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  118. <td class="paramname"><em>center</em>, </td>
  119. </tr>
  120. <tr>
  121. <td class="paramkey"></td>
  122. <td></td>
  123. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  124. <td class="paramname"><em>up</em>&#160;</td>
  125. </tr>
  126. <tr>
  127. <td></td>
  128. <td>)</td>
  129. <td></td><td></td>
  130. </tr>
  131. </table>
  132. </div><div class="memdoc">
  133. <p>Build a look at view matrix based on the default handedness. </p>
  134. <dl class="params"><dt>Parameters</dt><dd>
  135. <table class="params">
  136. <tr><td class="paramname">eye</td><td>Position of the camera </td></tr>
  137. <tr><td class="paramname">center</td><td>Position where the camera is looking at </td></tr>
  138. <tr><td class="paramname">up</td><td>Normalized up vector, how the camera is oriented. Typically (0, 0, 1)</td></tr>
  139. </table>
  140. </dd>
  141. </dl>
  142. <dl class="tparams"><dt>Template Parameters</dt><dd>
  143. <table class="tparams">
  144. <tr><td class="paramname">T</td><td>A floating-point scalar type </td></tr>
  145. <tr><td class="paramname">Q</td><td>A value from qualifier enum</td></tr>
  146. </table>
  147. </dd>
  148. </dl>
  149. <dl class="section see"><dt>See also</dt><dd>- frustum(T const&amp; left, T const&amp; right, T const&amp; bottom, T const&amp; top, T const&amp; nearVal, T const&amp; farVal) frustum(T const&amp; left, T const&amp; right, T const&amp; bottom, T const&amp; top, T const&amp; nearVal, T const&amp; farVal) </dd>
  150. <dd>
  151. <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml">gluLookAt man page</a> </dd></dl>
  152. </div>
  153. </div>
  154. <a id="gab2c09e25b0a16d3a9d89cc85bbae41b0"></a>
  155. <h2 class="memtitle"><span class="permalink"><a href="#gab2c09e25b0a16d3a9d89cc85bbae41b0">&#9670;&nbsp;</a></span>lookAtLH()</h2>
  156. <div class="memitem">
  157. <div class="memproto">
  158. <table class="memname">
  159. <tr>
  160. <td class="memname">GLM_FUNC_DECL mat&lt;4, 4, T, Q&gt; glm::lookAtLH </td>
  161. <td>(</td>
  162. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  163. <td class="paramname"><em>eye</em>, </td>
  164. </tr>
  165. <tr>
  166. <td class="paramkey"></td>
  167. <td></td>
  168. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  169. <td class="paramname"><em>center</em>, </td>
  170. </tr>
  171. <tr>
  172. <td class="paramkey"></td>
  173. <td></td>
  174. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  175. <td class="paramname"><em>up</em>&#160;</td>
  176. </tr>
  177. <tr>
  178. <td></td>
  179. <td>)</td>
  180. <td></td><td></td>
  181. </tr>
  182. </table>
  183. </div><div class="memdoc">
  184. <p>Build a left handed look at view matrix. </p>
  185. <dl class="params"><dt>Parameters</dt><dd>
  186. <table class="params">
  187. <tr><td class="paramname">eye</td><td>Position of the camera </td></tr>
  188. <tr><td class="paramname">center</td><td>Position where the camera is looking at </td></tr>
  189. <tr><td class="paramname">up</td><td>Normalized up vector, how the camera is oriented. Typically (0, 0, 1)</td></tr>
  190. </table>
  191. </dd>
  192. </dl>
  193. <dl class="tparams"><dt>Template Parameters</dt><dd>
  194. <table class="tparams">
  195. <tr><td class="paramname">T</td><td>A floating-point scalar type </td></tr>
  196. <tr><td class="paramname">Q</td><td>A value from qualifier enum</td></tr>
  197. </table>
  198. </dd>
  199. </dl>
  200. <dl class="section see"><dt>See also</dt><dd>- frustum(T const&amp; left, T const&amp; right, T const&amp; bottom, T const&amp; top, T const&amp; nearVal, T const&amp; farVal) frustum(T const&amp; left, T const&amp; right, T const&amp; bottom, T const&amp; top, T const&amp; nearVal, T const&amp; farVal) </dd></dl>
  201. </div>
  202. </div>
  203. <a id="gacfa12c8889c754846bc20c65d9b5c701"></a>
  204. <h2 class="memtitle"><span class="permalink"><a href="#gacfa12c8889c754846bc20c65d9b5c701">&#9670;&nbsp;</a></span>lookAtRH()</h2>
  205. <div class="memitem">
  206. <div class="memproto">
  207. <table class="memname">
  208. <tr>
  209. <td class="memname">GLM_FUNC_DECL mat&lt;4, 4, T, Q&gt; glm::lookAtRH </td>
  210. <td>(</td>
  211. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  212. <td class="paramname"><em>eye</em>, </td>
  213. </tr>
  214. <tr>
  215. <td class="paramkey"></td>
  216. <td></td>
  217. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  218. <td class="paramname"><em>center</em>, </td>
  219. </tr>
  220. <tr>
  221. <td class="paramkey"></td>
  222. <td></td>
  223. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  224. <td class="paramname"><em>up</em>&#160;</td>
  225. </tr>
  226. <tr>
  227. <td></td>
  228. <td>)</td>
  229. <td></td><td></td>
  230. </tr>
  231. </table>
  232. </div><div class="memdoc">
  233. <p>Build a right handed look at view matrix. </p>
  234. <dl class="params"><dt>Parameters</dt><dd>
  235. <table class="params">
  236. <tr><td class="paramname">eye</td><td>Position of the camera </td></tr>
  237. <tr><td class="paramname">center</td><td>Position where the camera is looking at </td></tr>
  238. <tr><td class="paramname">up</td><td>Normalized up vector, how the camera is oriented. Typically (0, 0, 1)</td></tr>
  239. </table>
  240. </dd>
  241. </dl>
  242. <dl class="tparams"><dt>Template Parameters</dt><dd>
  243. <table class="tparams">
  244. <tr><td class="paramname">T</td><td>A floating-point scalar type </td></tr>
  245. <tr><td class="paramname">Q</td><td>A value from qualifier enum</td></tr>
  246. </table>
  247. </dd>
  248. </dl>
  249. <dl class="section see"><dt>See also</dt><dd>- frustum(T const&amp; left, T const&amp; right, T const&amp; bottom, T const&amp; top, T const&amp; nearVal, T const&amp; farVal) frustum(T const&amp; left, T const&amp; right, T const&amp; bottom, T const&amp; top, T const&amp; nearVal, T const&amp; farVal) </dd></dl>
  250. </div>
  251. </div>
  252. <a id="gaee9e865eaa9776370996da2940873fd4"></a>
  253. <h2 class="memtitle"><span class="permalink"><a href="#gaee9e865eaa9776370996da2940873fd4">&#9670;&nbsp;</a></span>rotate()</h2>
  254. <div class="memitem">
  255. <div class="memproto">
  256. <table class="memname">
  257. <tr>
  258. <td class="memname">GLM_FUNC_DECL mat&lt;4, 4, T, Q&gt; glm::rotate </td>
  259. <td>(</td>
  260. <td class="paramtype">mat&lt; 4, 4, T, Q &gt; const &amp;&#160;</td>
  261. <td class="paramname"><em>m</em>, </td>
  262. </tr>
  263. <tr>
  264. <td class="paramkey"></td>
  265. <td></td>
  266. <td class="paramtype">T&#160;</td>
  267. <td class="paramname"><em>angle</em>, </td>
  268. </tr>
  269. <tr>
  270. <td class="paramkey"></td>
  271. <td></td>
  272. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  273. <td class="paramname"><em>axis</em>&#160;</td>
  274. </tr>
  275. <tr>
  276. <td></td>
  277. <td>)</td>
  278. <td></td><td></td>
  279. </tr>
  280. </table>
  281. </div><div class="memdoc">
  282. <p>Builds a rotation 4 * 4 matrix created from an axis vector and an angle. </p>
  283. <dl class="params"><dt>Parameters</dt><dd>
  284. <table class="params">
  285. <tr><td class="paramname">m</td><td>Input matrix multiplied by this rotation matrix. </td></tr>
  286. <tr><td class="paramname">angle</td><td>Rotation angle expressed in radians. </td></tr>
  287. <tr><td class="paramname">axis</td><td>Rotation axis, recommended to be normalized.</td></tr>
  288. </table>
  289. </dd>
  290. </dl>
  291. <dl class="tparams"><dt>Template Parameters</dt><dd>
  292. <table class="tparams">
  293. <tr><td class="paramname">T</td><td>A floating-point scalar type </td></tr>
  294. <tr><td class="paramname">Q</td><td>A value from qualifier enum</td></tr>
  295. </table>
  296. </dd>
  297. </dl>
  298. <dl class="section see"><dt>See also</dt><dd>- rotate(mat&lt;4, 4, T, Q&gt; const&amp; m, T angle, T x, T y, T z) </dd>
  299. <dd>
  300. - rotate(T angle, vec&lt;3, T, Q&gt; const&amp; v) </dd>
  301. <dd>
  302. <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glRotate.xml">glRotate man page</a> </dd></dl>
  303. </div>
  304. </div>
  305. <a id="ga05051adbee603fb3c5095d8cf5cc229b"></a>
  306. <h2 class="memtitle"><span class="permalink"><a href="#ga05051adbee603fb3c5095d8cf5cc229b">&#9670;&nbsp;</a></span>scale()</h2>
  307. <div class="memitem">
  308. <div class="memproto">
  309. <table class="memname">
  310. <tr>
  311. <td class="memname">GLM_FUNC_DECL mat&lt;4, 4, T, Q&gt; glm::scale </td>
  312. <td>(</td>
  313. <td class="paramtype">mat&lt; 4, 4, T, Q &gt; const &amp;&#160;</td>
  314. <td class="paramname"><em>m</em>, </td>
  315. </tr>
  316. <tr>
  317. <td class="paramkey"></td>
  318. <td></td>
  319. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  320. <td class="paramname"><em>v</em>&#160;</td>
  321. </tr>
  322. <tr>
  323. <td></td>
  324. <td>)</td>
  325. <td></td><td></td>
  326. </tr>
  327. </table>
  328. </div><div class="memdoc">
  329. <p>Builds a scale 4 * 4 matrix created from 3 scalars. </p>
  330. <dl class="params"><dt>Parameters</dt><dd>
  331. <table class="params">
  332. <tr><td class="paramname">m</td><td>Input matrix multiplied by this scale matrix. </td></tr>
  333. <tr><td class="paramname">v</td><td>Ratio of scaling for each axis.</td></tr>
  334. </table>
  335. </dd>
  336. </dl>
  337. <dl class="tparams"><dt>Template Parameters</dt><dd>
  338. <table class="tparams">
  339. <tr><td class="paramname">T</td><td>A floating-point scalar type </td></tr>
  340. <tr><td class="paramname">Q</td><td>A value from qualifier enum</td></tr>
  341. </table>
  342. </dd>
  343. </dl>
  344. <dl class="section see"><dt>See also</dt><dd>- scale(mat&lt;4, 4, T, Q&gt; const&amp; m, T x, T y, T z) </dd>
  345. <dd>
  346. - scale(vec&lt;3, T, Q&gt; const&amp; v) </dd>
  347. <dd>
  348. <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glScale.xml">glScale man page</a> </dd></dl>
  349. </div>
  350. </div>
  351. <a id="ga1a4ecc4ad82652b8fb14dcb087879284"></a>
  352. <h2 class="memtitle"><span class="permalink"><a href="#ga1a4ecc4ad82652b8fb14dcb087879284">&#9670;&nbsp;</a></span>translate()</h2>
  353. <div class="memitem">
  354. <div class="memproto">
  355. <table class="memname">
  356. <tr>
  357. <td class="memname">GLM_FUNC_DECL mat&lt;4, 4, T, Q&gt; glm::translate </td>
  358. <td>(</td>
  359. <td class="paramtype">mat&lt; 4, 4, T, Q &gt; const &amp;&#160;</td>
  360. <td class="paramname"><em>m</em>, </td>
  361. </tr>
  362. <tr>
  363. <td class="paramkey"></td>
  364. <td></td>
  365. <td class="paramtype">vec&lt; 3, T, Q &gt; const &amp;&#160;</td>
  366. <td class="paramname"><em>v</em>&#160;</td>
  367. </tr>
  368. <tr>
  369. <td></td>
  370. <td>)</td>
  371. <td></td><td></td>
  372. </tr>
  373. </table>
  374. </div><div class="memdoc">
  375. <p>Builds a translation 4 * 4 matrix created from a vector of 3 components. </p>
  376. <dl class="params"><dt>Parameters</dt><dd>
  377. <table class="params">
  378. <tr><td class="paramname">m</td><td>Input matrix multiplied by this translation matrix. </td></tr>
  379. <tr><td class="paramname">v</td><td>Coordinates of a translation vector.</td></tr>
  380. </table>
  381. </dd>
  382. </dl>
  383. <dl class="tparams"><dt>Template Parameters</dt><dd>
  384. <table class="tparams">
  385. <tr><td class="paramname">T</td><td>A floating-point scalar type </td></tr>
  386. <tr><td class="paramname">Q</td><td>A value from qualifier enum</td></tr>
  387. </table>
  388. </dd>
  389. </dl>
  390. <div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="a00386.html">glm/glm.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="a01364.html">glm/gtc/matrix_transform.hpp</a>&gt;</span></div><div class="line">...</div><div class="line">glm::mat4 m = <a class="code" href="a00668.html#ga1a4ecc4ad82652b8fb14dcb087879284">glm::translate</a>(<a class="code" href="a00701.html#ga0db98d836c5549d31cf64ecd043b7af7">glm::mat4</a>(1.0f), <a class="code" href="a00699.html#ga9c3019b13faf179e4ad3626ea66df334">glm::vec3</a>(1.0f));</div><div class="line"><span class="comment">// m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f</span></div><div class="line"><span class="comment">// m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f</span></div><div class="line"><span class="comment">// m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f</span></div><div class="line"><span class="comment">// m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f</span></div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd>- translate(mat&lt;4, 4, T, Q&gt; const&amp; m, T x, T y, T z) </dd>
  391. <dd>
  392. - translate(vec&lt;3, T, Q&gt; const&amp; v) </dd>
  393. <dd>
  394. <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTranslate.xml">glTranslate man page</a> </dd></dl>
  395. </div>
  396. </div>
  397. </div><!-- contents -->
  398. <!-- start footer part -->
  399. <hr class="footer"/><address class="footer"><small>
  400. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  401. <img class="footer" src="doxygen.png" alt="doxygen"/>
  402. </a> 1.8.14
  403. </small></address>
  404. </body>
  405. </html>