glm/doc/api-0.9.3/a00144.html

360 lines
15 KiB
HTML
Raw Normal View History

2011-11-12 23:26:02 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Geometric functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"></td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>Geometric functions</h1> </div>
<div class="ingroups"><a class="el" href="a00154.html">GLM Core</a></div></div>
<div class="contents">
<p>These operate on vectors as vectors, not component-wise.
<a href="#_details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename valType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">detail::tvec3&lt; valType &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gaf2c23b0c90b3569b2c9a3e4e0ada4cd4">cross</a> (detail::tvec3&lt; valType &gt; const &amp;x, detail::tvec3&lt; valType &gt; const &amp;y)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gad8e0b5e88b74b373c2820142ad2b4103">distance</a> (genType const &amp;p0, genType const &amp;p1)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gaf7ca312d4c8949ecfe9615d9777aa242">dot</a> (genType const &amp;x, genType const &amp;y)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gafbf77dccfcfedf5dd480771c6794e27b">faceforward</a> (genType const &amp;N, genType const &amp;I, genType const &amp;Nref)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga60de55d549a96b9303730a10173e6fa3">length</a> (genType const &amp;x)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gabbb9186ee077ee7664dc51d05df3f43d">normalize</a> (genType const &amp;x)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga8db5042950e76a6fcb5bbddfbd1d254d">reflect</a> (genType const &amp;I, genType const &amp;N)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gacda8041bcba8c9698a799c911c7fefdf">refract</a> (genType const &amp;I, genType const &amp;N, typename genType::value_type const &amp;eta)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>These operate on vectors as vectors, not component-wise. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf2c23b0c90b3569b2c9a3e4e0ada4cd4"></a><!-- doxytag: member="glm::cross" ref="gaf2c23b0c90b3569b2c9a3e4e0ada4cd4" args="(detail::tvec3&lt; valType &gt; const &amp;x, detail::tvec3&lt; valType &gt; const &amp;y)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">detail::tvec3&lt;valType&gt; glm::cross </td>
<td>(</td>
<td class="paramtype">detail::tvec3&lt; valType &gt; const &amp;&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">detail::tvec3&lt; valType &gt; const &amp;&#160;</td>
<td class="paramname"><em>y</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the cross product of x and y. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">valType</td><td>Floating-point scalar types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="gad8e0b5e88b74b373c2820142ad2b4103"></a><!-- doxytag: member="glm::distance" ref="gad8e0b5e88b74b373c2820142ad2b4103" args="(genType const &amp;p0, genType const &amp;p1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType::value_type glm::distance </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>p0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>p1</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">genType</td><td>Floating-point vector types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="gaf7ca312d4c8949ecfe9615d9777aa242"></a><!-- doxytag: member="glm::dot" ref="gaf7ca312d4c8949ecfe9615d9777aa242" args="(genType const &amp;x, genType const &amp;y)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType::value_type glm::dot </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>y</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the dot product of x and y, i.e., result = x * y. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">genType</td><td>Floating-point vector types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="gafbf77dccfcfedf5dd480771c6794e27b"></a><!-- doxytag: member="glm::faceforward" ref="gafbf77dccfcfedf5dd480771c6794e27b" args="(genType const &amp;N, genType const &amp;I, genType const &amp;Nref)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::faceforward </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>N</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>I</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>Nref</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>If dot(Nref, I) &lt; 0.0, return N, otherwise, return -N. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">genType</td><td>Floating-point vector types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga60de55d549a96b9303730a10173e6fa3"></a><!-- doxytag: member="glm::length" ref="ga60de55d549a96b9303730a10173e6fa3" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType::value_type glm::length </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>x</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the length of x, i.e., sqrt(x * x). </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">genType</td><td>Floating-point vector types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="gabbb9186ee077ee7664dc51d05df3f43d"></a><!-- doxytag: member="glm::normalize" ref="gabbb9186ee077ee7664dc51d05df3f43d" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::normalize </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>x</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a vector in the same direction as x but with length of 1. </p>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga8db5042950e76a6fcb5bbddfbd1d254d"></a><!-- doxytag: member="glm::reflect" ref="ga8db5042950e76a6fcb5bbddfbd1d254d" args="(genType const &amp;I, genType const &amp;N)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::reflect </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>I</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>N</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">genType</td><td>Floating-point vector types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
<a class="anchor" id="gacda8041bcba8c9698a799c911c7fefdf"></a><!-- doxytag: member="glm::refract" ref="gacda8041bcba8c9698a799c911c7fefdf" args="(genType const &amp;I, genType const &amp;N, typename genType::value_type const &amp;eta)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::refract </td>
<td>(</td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>I</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType const &amp;&#160;</td>
<td class="paramname"><em>N</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">typename genType::value_type const &amp;&#160;</td>
<td class="paramname"><em>eta</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
<table class="">
<tr><td class="paramname">genType</td><td>Floating-point vector types. </td></tr>
</table>
</dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd>- <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a> </dd>
<dd>
- <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> </dd></dl>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>