a00027_source.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. <title>func_geometric.hpp Source File</title>
  7. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  8. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  9. </head>
  10. <body>
  11. <div id="top"><!-- do not remove this div! -->
  12. <div id="titlearea">
  13. <table cellspacing="0" cellpadding="0">
  14. <tbody>
  15. <tr style="height: 56px;">
  16. <td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
  17. </tr>
  18. </tbody>
  19. </table>
  20. </div>
  21. <!-- Generated by Doxygen 1.7.6.1 -->
  22. <div id="navrow1" class="tabs">
  23. <ul class="tablist">
  24. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  25. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  26. <li><a href="modules.html"><span>Modules</span></a></li>
  27. <li><a href="annotated.html"><span>Classes</span></a></li>
  28. <li class="current"><a href="files.html"><span>Files</span></a></li>
  29. </ul>
  30. </div>
  31. <div id="navrow2" class="tabs2">
  32. <ul class="tablist">
  33. <li><a href="files.html"><span>File&#160;List</span></a></li>
  34. </ul>
  35. </div>
  36. </div>
  37. <div class="header">
  38. <div class="headertitle">
  39. <div class="title">func_geometric.hpp</div> </div>
  40. </div><!--header-->
  41. <div class="contents">
  42. <a href="a00027.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
  43. <a name="l00002"></a>00002
  44. <a name="l00003"></a>00003
  45. <a name="l00004"></a>00004
  46. <a name="l00005"></a>00005
  47. <a name="l00006"></a>00006
  48. <a name="l00007"></a>00007
  49. <a name="l00008"></a>00008
  50. <a name="l00009"></a>00009
  51. <a name="l00010"></a>00010
  52. <a name="l00011"></a>00011
  53. <a name="l00012"></a>00012
  54. <a name="l00013"></a>00013
  55. <a name="l00014"></a>00014
  56. <a name="l00015"></a>00015
  57. <a name="l00016"></a>00016
  58. <a name="l00017"></a>00017
  59. <a name="l00018"></a>00018
  60. <a name="l00019"></a>00019
  61. <a name="l00020"></a>00020
  62. <a name="l00021"></a>00021
  63. <a name="l00022"></a>00022
  64. <a name="l00023"></a>00023
  65. <a name="l00024"></a>00024
  66. <a name="l00025"></a>00025
  67. <a name="l00026"></a>00026
  68. <a name="l00027"></a>00027
  69. <a name="l00028"></a>00028
  70. <a name="l00029"></a>00029
  71. <a name="l00030"></a>00030
  72. <a name="l00031"></a>00031
  73. <a name="l00032"></a>00032
  74. <a name="l00033"></a>00033
  75. <a name="l00034"></a>00034
  76. <a name="l00035"></a>00035
  77. <a name="l00036"></a>00036 <span class="preprocessor">#ifndef glm_core_func_geometric</span>
  78. <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define glm_core_func_geometric GLM_VERSION</span>
  79. <a name="l00038"></a>00038 <span class="preprocessor"></span>
  80. <a name="l00039"></a>00039 <span class="keyword">namespace </span>glm
  81. <a name="l00040"></a>00040 {
  82. <a name="l00043"></a>00043
  83. <a name="l00050"></a>00050 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  84. <a name="l00051"></a>00051 <span class="keyword">typename</span> genType::value_type <a class="code" href="a00127.html#ga282360c8bb80b80d3c7f5bc00766d873" title="Returns the length of x, i.e., sqrt(x * x).">length</a>(
  85. <a name="l00052"></a>00052 genType <span class="keyword">const</span> &amp; x);
  86. <a name="l00053"></a>00053
  87. <a name="l00060"></a>00060 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  88. <a name="l00061"></a>00061 <span class="keyword">typename</span> genType::value_type <a class="code" href="a00127.html#ga3fac0e61144f60184d961dd156709dd3" title="Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).">distance</a>(
  89. <a name="l00062"></a>00062 genType <span class="keyword">const</span> &amp; p0,
  90. <a name="l00063"></a>00063 genType <span class="keyword">const</span> &amp; p1);
  91. <a name="l00064"></a>00064
  92. <a name="l00071"></a>00071 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  93. <a name="l00072"></a>00072 <span class="keyword">typename</span> genType::value_type <a class="code" href="a00127.html#ga7a31d2864eccfe665409e3b44f5e6e8d" title="Returns the dot product of x and y, i.e., result = x * y.">dot</a>(
  94. <a name="l00073"></a>00073 genType <span class="keyword">const</span> &amp; x,
  95. <a name="l00074"></a>00074 genType <span class="keyword">const</span> &amp; y);
  96. <a name="l00075"></a>00075
  97. <a name="l00082"></a>00082 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> valType&gt;
  98. <a name="l00083"></a>00083 detail::tvec3&lt;valType&gt; <a class="code" href="a00127.html#gaa127ddc9d38f715125f91742d399eb6f" title="Returns the cross product of x and y.">cross</a>(
  99. <a name="l00084"></a>00084 detail::tvec3&lt;valType&gt; <span class="keyword">const</span> &amp; x,
  100. <a name="l00085"></a>00085 detail::tvec3&lt;valType&gt; <span class="keyword">const</span> &amp; y);
  101. <a name="l00086"></a>00086
  102. <a name="l00091"></a>00091 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  103. <a name="l00092"></a>00092 genType <a class="code" href="a00127.html#ga68b931c228750eeba844c273c54ca43d" title="Returns a vector in the same direction as x but with length of 1.">normalize</a>(
  104. <a name="l00093"></a>00093 genType <span class="keyword">const</span> &amp; x);
  105. <a name="l00094"></a>00094
  106. <a name="l00101"></a>00101 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  107. <a name="l00102"></a>00102 genType <a class="code" href="a00127.html#ga855fc5fd7779df1683482564956c6764" title="If dot(Nref, I) &lt; 0.0, return N, otherwise, return -N.">faceforward</a>(
  108. <a name="l00103"></a>00103 genType <span class="keyword">const</span> &amp; N,
  109. <a name="l00104"></a>00104 genType <span class="keyword">const</span> &amp; I,
  110. <a name="l00105"></a>00105 genType <span class="keyword">const</span> &amp; Nref);
  111. <a name="l00106"></a>00106
  112. <a name="l00114"></a>00114 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  113. <a name="l00115"></a>00115 genType <a class="code" href="a00127.html#gabe1fa0bef5f854242eb70ce56e5a7d03" title="For the incident vector I and surface orientation N, returns the reflection direction : result = I - ...">reflect</a>(
  114. <a name="l00116"></a>00116 genType <span class="keyword">const</span> &amp; I,
  115. <a name="l00117"></a>00117 genType <span class="keyword">const</span> &amp; N);
  116. <a name="l00118"></a>00118
  117. <a name="l00127"></a>00127 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> genType&gt;
  118. <a name="l00128"></a>00128 genType <a class="code" href="a00127.html#gabbb4909d3e99a7a2411cc63252afbbd8" title="For the incident vector I and surface normal N, and the ratio of indices of refraction eta...">refract</a>(
  119. <a name="l00129"></a>00129 genType <span class="keyword">const</span> &amp; I,
  120. <a name="l00130"></a>00130 genType <span class="keyword">const</span> &amp; N,
  121. <a name="l00131"></a>00131 <span class="keyword">typename</span> genType::value_type <span class="keyword">const</span> &amp; eta);
  122. <a name="l00132"></a>00132
  123. <a name="l00134"></a>00134 }<span class="comment">//namespace glm</span>
  124. <a name="l00135"></a>00135
  125. <a name="l00136"></a>00136 <span class="preprocessor">#include &quot;func_geometric.inl&quot;</span>
  126. <a name="l00137"></a>00137
  127. <a name="l00138"></a>00138 <span class="preprocessor">#endif//glm_core_func_geometric</span>
  128. </pre></div></div><!-- contents -->
  129. <hr class="footer"/><address class="footer"><small>
  130. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  131. <img class="footer" src="doxygen.png" alt="doxygen"/>
  132. </a> 1.7.6.1
  133. </small></address>
  134. </body>
  135. </html>