a00129.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. <title>GLM: glm::core::function::geometric Namespace Reference</title>
  6. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  7. <link href="doxygen.css" rel="stylesheet" type="text/css"/>
  8. </head>
  9. <body>
  10. <!-- Generated by Doxygen 1.6.1 -->
  11. <div class="navigation" id="top">
  12. <div class="tabs">
  13. <ul>
  14. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  15. <li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
  16. <li><a href="files.html"><span>Files</span></a></li>
  17. </ul>
  18. </div>
  19. <div class="tabs">
  20. <ul>
  21. <li><a href="namespaces.html"><span>Namespace&nbsp;List</span></a></li>
  22. <li><a href="namespacemembers.html"><span>Namespace&nbsp;Members</span></a></li>
  23. </ul>
  24. </div>
  25. <div class="navpath"><a class="el" href="a00124.html">glm</a>::<a class="el" href="a00125.html">core</a>::<a class="el" href="a00126.html">function</a>::<a class="el" href="a00129.html">geometric</a>
  26. </div>
  27. </div>
  28. <div class="contents">
  29. <h1>glm::core::function::geometric Namespace Reference</h1>
  30. <p>Define all <a class="el" href="a00129.html" title="Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included...">geometric</a> functions from Section 8.4 of GLSL 1.30.8 specification. Included in <a class="el" href="a00124.html" title="GLM namespace, it contains all GLSL based features.">glm</a> namespace.
  31. <a href="#_details">More...</a></p>
  32. <table border="0" cellpadding="0" cellspacing="0">
  33. <tr><td colspan="2"><h2>Functions</h2></td></tr>
  34. <tr><td class="memTemplParams" colspan="2">template&lt;typename valType &gt; </td></tr>
  35. <tr><td class="memTemplItemLeft" align="right" valign="top">detail::tvec3&lt; valType &gt;&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#aef2c634b57ee979caa2ab897b6960e1f">cross</a> (detail::tvec3&lt; valType &gt; const &amp;x, detail::tvec3&lt; valType &gt; const &amp;y)</td></tr>
  36. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the cross product of x and y. <a href="#aef2c634b57ee979caa2ab897b6960e1f"></a><br/></td></tr>
  37. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  38. <tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#aa7cb6dbe9b8224c25345f1fd6fc09e77">distance</a> (genType const &amp;p0, genType const &amp;p1)</td></tr>
  39. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). <a href="#aa7cb6dbe9b8224c25345f1fd6fc09e77"></a><br/></td></tr>
  40. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  41. <tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#a38e1f1538ac0fedc9d6ac14910105421">dot</a> (genType const &amp;x, genType const &amp;y)</td></tr>
  42. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the dot product of x and y, i.e., result = x * y. <a href="#a38e1f1538ac0fedc9d6ac14910105421"></a><br/></td></tr>
  43. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  44. <tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#ad591e8f7b1a5e311d3439dda2bb82aea">faceforward</a> (genType const &amp;N, genType const &amp;I, genType const &amp;Nref)</td></tr>
  45. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If dot(Nref, I) &lt; 0.0, return N, otherwise, return -N. <a href="#ad591e8f7b1a5e311d3439dda2bb82aea"></a><br/></td></tr>
  46. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  47. <tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#a10ee9a1d18c6da61cab61d8637d23847">length</a> (genType const &amp;x)</td></tr>
  48. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the length of x, i.e., sqrt(x * x). <a href="#a10ee9a1d18c6da61cab61d8637d23847"></a><br/></td></tr>
  49. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  50. <tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#a07ff16965f11fa17122ac874ed492276">normalize</a> (genType const &amp;x)</td></tr>
  51. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a vector in the same direction as x but with length of 1. <a href="#a07ff16965f11fa17122ac874ed492276"></a><br/></td></tr>
  52. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  53. <tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#a2863d2331eb3752a5a17244c604c1d07">reflect</a> (genType const &amp;I, genType const &amp;N)</td></tr>
  54. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. <a href="#a2863d2331eb3752a5a17244c604c1d07"></a><br/></td></tr>
  55. <tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
  56. <tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00129.html#a895392ad98499a450e2cc8579d76a84d">refract</a> (genType const &amp;I, genType const &amp;N, typename genType::value_type const &amp;eta)</td></tr>
  57. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. <a href="#a895392ad98499a450e2cc8579d76a84d"></a><br/></td></tr>
  58. </table>
  59. <hr/><a name="_details"></a><h2>Detailed Description</h2>
  60. <p>Define all <a class="el" href="a00129.html" title="Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included...">geometric</a> functions from Section 8.4 of GLSL 1.30.8 specification. Included in <a class="el" href="a00124.html" title="GLM namespace, it contains all GLSL based features.">glm</a> namespace. </p>
  61. <hr/><h2>Function Documentation</h2>
  62. <a class="anchor" id="aef2c634b57ee979caa2ab897b6960e1f"></a><!-- doxytag: member="glm::core::function::geometric::cross" ref="aef2c634b57ee979caa2ab897b6960e1f" args="(detail::tvec3&lt; valType &gt; const &amp;x, detail::tvec3&lt; valType &gt; const &amp;y)" -->
  63. <div class="memitem">
  64. <div class="memproto">
  65. <table class="memname">
  66. <tr>
  67. <td class="memname">detail::tvec3&lt;valType&gt; glm::core::function::geometric::cross </td>
  68. <td>(</td>
  69. <td class="paramtype">detail::tvec3&lt; valType &gt; const &amp;&nbsp;</td>
  70. <td class="paramname"> <em>x</em>, </td>
  71. </tr>
  72. <tr>
  73. <td class="paramkey"></td>
  74. <td></td>
  75. <td class="paramtype">detail::tvec3&lt; valType &gt; const &amp;&nbsp;</td>
  76. <td class="paramname"> <em>y</em></td><td>&nbsp;</td>
  77. </tr>
  78. <tr>
  79. <td></td>
  80. <td>)</td>
  81. <td></td><td></td><td></td>
  82. </tr>
  83. </table>
  84. </div>
  85. <div class="memdoc">
  86. <p>Returns the cross product of x and y. </p>
  87. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  88. </div>
  89. </div>
  90. <a class="anchor" id="aa7cb6dbe9b8224c25345f1fd6fc09e77"></a><!-- doxytag: member="glm::core::function::geometric::distance" ref="aa7cb6dbe9b8224c25345f1fd6fc09e77" args="(genType const &amp;p0, genType const &amp;p1)" -->
  91. <div class="memitem">
  92. <div class="memproto">
  93. <table class="memname">
  94. <tr>
  95. <td class="memname">genType::value_type glm::core::function::geometric::distance </td>
  96. <td>(</td>
  97. <td class="paramtype">genType const &amp;&nbsp;</td>
  98. <td class="paramname"> <em>p0</em>, </td>
  99. </tr>
  100. <tr>
  101. <td class="paramkey"></td>
  102. <td></td>
  103. <td class="paramtype">genType const &amp;&nbsp;</td>
  104. <td class="paramname"> <em>p1</em></td><td>&nbsp;</td>
  105. </tr>
  106. <tr>
  107. <td></td>
  108. <td>)</td>
  109. <td></td><td></td><td></td>
  110. </tr>
  111. </table>
  112. </div>
  113. <div class="memdoc">
  114. <p>Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). </p>
  115. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  116. </div>
  117. </div>
  118. <a class="anchor" id="a38e1f1538ac0fedc9d6ac14910105421"></a><!-- doxytag: member="glm::core::function::geometric::dot" ref="a38e1f1538ac0fedc9d6ac14910105421" args="(genType const &amp;x, genType const &amp;y)" -->
  119. <div class="memitem">
  120. <div class="memproto">
  121. <table class="memname">
  122. <tr>
  123. <td class="memname">genType::value_type glm::core::function::geometric::dot </td>
  124. <td>(</td>
  125. <td class="paramtype">genType const &amp;&nbsp;</td>
  126. <td class="paramname"> <em>x</em>, </td>
  127. </tr>
  128. <tr>
  129. <td class="paramkey"></td>
  130. <td></td>
  131. <td class="paramtype">genType const &amp;&nbsp;</td>
  132. <td class="paramname"> <em>y</em></td><td>&nbsp;</td>
  133. </tr>
  134. <tr>
  135. <td></td>
  136. <td>)</td>
  137. <td></td><td></td><td></td>
  138. </tr>
  139. </table>
  140. </div>
  141. <div class="memdoc">
  142. <p>Returns the dot product of x and y, i.e., result = x * y. </p>
  143. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  144. </div>
  145. </div>
  146. <a class="anchor" id="ad591e8f7b1a5e311d3439dda2bb82aea"></a><!-- doxytag: member="glm::core::function::geometric::faceforward" ref="ad591e8f7b1a5e311d3439dda2bb82aea" args="(genType const &amp;N, genType const &amp;I, genType const &amp;Nref)" -->
  147. <div class="memitem">
  148. <div class="memproto">
  149. <table class="memname">
  150. <tr>
  151. <td class="memname">genType glm::core::function::geometric::faceforward </td>
  152. <td>(</td>
  153. <td class="paramtype">genType const &amp;&nbsp;</td>
  154. <td class="paramname"> <em>N</em>, </td>
  155. </tr>
  156. <tr>
  157. <td class="paramkey"></td>
  158. <td></td>
  159. <td class="paramtype">genType const &amp;&nbsp;</td>
  160. <td class="paramname"> <em>I</em>, </td>
  161. </tr>
  162. <tr>
  163. <td class="paramkey"></td>
  164. <td></td>
  165. <td class="paramtype">genType const &amp;&nbsp;</td>
  166. <td class="paramname"> <em>Nref</em></td><td>&nbsp;</td>
  167. </tr>
  168. <tr>
  169. <td></td>
  170. <td>)</td>
  171. <td></td><td></td><td></td>
  172. </tr>
  173. </table>
  174. </div>
  175. <div class="memdoc">
  176. <p>If dot(Nref, I) &lt; 0.0, return N, otherwise, return -N. </p>
  177. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  178. </div>
  179. </div>
  180. <a class="anchor" id="a10ee9a1d18c6da61cab61d8637d23847"></a><!-- doxytag: member="glm::core::function::geometric::length" ref="a10ee9a1d18c6da61cab61d8637d23847" args="(genType const &amp;x)" -->
  181. <div class="memitem">
  182. <div class="memproto">
  183. <table class="memname">
  184. <tr>
  185. <td class="memname">genType::value_type glm::core::function::geometric::length </td>
  186. <td>(</td>
  187. <td class="paramtype">genType const &amp;&nbsp;</td>
  188. <td class="paramname"> <em>x</em></td>
  189. <td>&nbsp;)&nbsp;</td>
  190. <td></td>
  191. </tr>
  192. </table>
  193. </div>
  194. <div class="memdoc">
  195. <p>Returns the length of x, i.e., sqrt(x * x). </p>
  196. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  197. </div>
  198. </div>
  199. <a class="anchor" id="a07ff16965f11fa17122ac874ed492276"></a><!-- doxytag: member="glm::core::function::geometric::normalize" ref="a07ff16965f11fa17122ac874ed492276" args="(genType const &amp;x)" -->
  200. <div class="memitem">
  201. <div class="memproto">
  202. <table class="memname">
  203. <tr>
  204. <td class="memname">genType glm::core::function::geometric::normalize </td>
  205. <td>(</td>
  206. <td class="paramtype">genType const &amp;&nbsp;</td>
  207. <td class="paramname"> <em>x</em></td>
  208. <td>&nbsp;)&nbsp;</td>
  209. <td></td>
  210. </tr>
  211. </table>
  212. </div>
  213. <div class="memdoc">
  214. <p>Returns a vector in the same direction as x but with length of 1. </p>
  215. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  216. </div>
  217. </div>
  218. <a class="anchor" id="a2863d2331eb3752a5a17244c604c1d07"></a><!-- doxytag: member="glm::core::function::geometric::reflect" ref="a2863d2331eb3752a5a17244c604c1d07" args="(genType const &amp;I, genType const &amp;N)" -->
  219. <div class="memitem">
  220. <div class="memproto">
  221. <table class="memname">
  222. <tr>
  223. <td class="memname">genType glm::core::function::geometric::reflect </td>
  224. <td>(</td>
  225. <td class="paramtype">genType const &amp;&nbsp;</td>
  226. <td class="paramname"> <em>I</em>, </td>
  227. </tr>
  228. <tr>
  229. <td class="paramkey"></td>
  230. <td></td>
  231. <td class="paramtype">genType const &amp;&nbsp;</td>
  232. <td class="paramname"> <em>N</em></td><td>&nbsp;</td>
  233. </tr>
  234. <tr>
  235. <td></td>
  236. <td>)</td>
  237. <td></td><td></td><td></td>
  238. </tr>
  239. </table>
  240. </div>
  241. <div class="memdoc">
  242. <p>For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. </p>
  243. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  244. </div>
  245. </div>
  246. <a class="anchor" id="a895392ad98499a450e2cc8579d76a84d"></a><!-- doxytag: member="glm::core::function::geometric::refract" ref="a895392ad98499a450e2cc8579d76a84d" args="(genType const &amp;I, genType const &amp;N, typename genType::value_type const &amp;eta)" -->
  247. <div class="memitem">
  248. <div class="memproto">
  249. <table class="memname">
  250. <tr>
  251. <td class="memname">genType glm::core::function::geometric::refract </td>
  252. <td>(</td>
  253. <td class="paramtype">genType const &amp;&nbsp;</td>
  254. <td class="paramname"> <em>I</em>, </td>
  255. </tr>
  256. <tr>
  257. <td class="paramkey"></td>
  258. <td></td>
  259. <td class="paramtype">genType const &amp;&nbsp;</td>
  260. <td class="paramname"> <em>N</em>, </td>
  261. </tr>
  262. <tr>
  263. <td class="paramkey"></td>
  264. <td></td>
  265. <td class="paramtype">typename genType::value_type const &amp;&nbsp;</td>
  266. <td class="paramname"> <em>eta</em></td><td>&nbsp;</td>
  267. </tr>
  268. <tr>
  269. <td></td>
  270. <td>)</td>
  271. <td></td><td></td><td></td>
  272. </tr>
  273. </table>
  274. </div>
  275. <div class="memdoc">
  276. <p>For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. </p>
  277. <p>(From GLSL 1.30.08 specification, section 8.4) </p>
  278. </div>
  279. </div>
  280. </div>
  281. <hr size="1"/><address style="text-align: right;"><small>Generated on Mon Nov 16 11:23:23 2009 for GLM by&nbsp;
  282. <a href="http://www.doxygen.org/index.html">
  283. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
  284. </body>
  285. </html>