mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
376 lines
16 KiB
HTML
376 lines
16 KiB
HTML
<!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>
|
|
<div id="top"><!-- do not remove this div! -->
|
|
|
|
|
|
<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>
|
|
|
|
<!-- Generated by Doxygen 1.7.5 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related 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">
|
|
<div class="title">Geometric functions</div> </div>
|
|
<div class="ingroups"><a class="el" href="a00154.html">GLM Core</a></div></div>
|
|
<div class="contents">
|
|
<table class="memberdecls">
|
|
<tr><td colspan="2"><h2><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename valType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">detail::tvec3< valType > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gaa127ddc9d38f715125f91742d399eb6f">cross</a> (detail::tvec3< valType > const &x, detail::tvec3< valType > const &y)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga3fac0e61144f60184d961dd156709dd3">distance</a> (genType const &p0, genType const &p1)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga7a31d2864eccfe665409e3b44f5e6e8d">dot</a> (genType const &x, genType const &y)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga855fc5fd7779df1683482564956c6764">faceforward</a> (genType const &N, genType const &I, genType const &Nref)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::value_type </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga282360c8bb80b80d3c7f5bc00766d873">length</a> (genType const &x)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#ga68b931c228750eeba844c273c54ca43d">normalize</a> (genType const &x)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gabe1fa0bef5f854242eb70ce56e5a7d03">reflect</a> (genType const &I, genType const &N)</td></tr>
|
|
<tr><td class="memTemplParams" colspan="2">template<typename genType > </td></tr>
|
|
<tr><td class="memTemplItemLeft" align="right" valign="top">genType </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00144.html#gabbb4909d3e99a7a2411cc63252afbbd8">refract</a> (genType const &I, genType const &N, typename genType::value_type const &eta)</td></tr>
|
|
</table>
|
|
<hr/><a name="details" id="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="gaa127ddc9d38f715125f91742d399eb6f"></a><!-- doxytag: member="glm::cross" ref="gaa127ddc9d38f715125f91742d399eb6f" args="(detail::tvec3< valType > const &x, detail::tvec3< valType > const &y)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">detail::tvec3<valType> glm::cross </td>
|
|
<td>(</td>
|
|
<td class="paramtype">detail::tvec3< valType > const & </td>
|
|
<td class="paramname"><em>x</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">detail::tvec3< valType > const & </td>
|
|
<td class="paramname"><em>y</em> </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga3fac0e61144f60184d961dd156709dd3"></a><!-- doxytag: member="glm::distance" ref="ga3fac0e61144f60184d961dd156709dd3" args="(genType const &p0, genType const &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 & </td>
|
|
<td class="paramname"><em>p0</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">genType const & </td>
|
|
<td class="paramname"><em>p1</em> </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga7a31d2864eccfe665409e3b44f5e6e8d"></a><!-- doxytag: member="glm::dot" ref="ga7a31d2864eccfe665409e3b44f5e6e8d" args="(genType const &x, genType const &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 & </td>
|
|
<td class="paramname"><em>x</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">genType const & </td>
|
|
<td class="paramname"><em>y</em> </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga855fc5fd7779df1683482564956c6764"></a><!-- doxytag: member="glm::faceforward" ref="ga855fc5fd7779df1683482564956c6764" args="(genType const &N, genType const &I, genType const &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 & </td>
|
|
<td class="paramname"><em>N</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">genType const & </td>
|
|
<td class="paramname"><em>I</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">genType const & </td>
|
|
<td class="paramname"><em>Nref</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>If dot(Nref, I) < 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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga282360c8bb80b80d3c7f5bc00766d873"></a><!-- doxytag: member="glm::length" ref="ga282360c8bb80b80d3c7f5bc00766d873" args="(genType const &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 & </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga68b931c228750eeba844c273c54ca43d"></a><!-- doxytag: member="glm::normalize" ref="ga68b931c228750eeba844c273c54ca43d" args="(genType const &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 & </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gabe1fa0bef5f854242eb70ce56e5a7d03"></a><!-- doxytag: member="glm::reflect" ref="gabe1fa0bef5f854242eb70ce56e5a7d03" args="(genType const &I, genType const &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 & </td>
|
|
<td class="paramname"><em>I</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">genType const & </td>
|
|
<td class="paramname"><em>N</em> </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gabbb4909d3e99a7a2411cc63252afbbd8"></a><!-- doxytag: member="glm::refract" ref="gabbb4909d3e99a7a2411cc63252afbbd8" args="(genType const &I, genType const &N, typename genType::value_type const &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 & </td>
|
|
<td class="paramname"><em>I</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">genType const & </td>
|
|
<td class="paramname"><em>N</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">typename genType::value_type const & </td>
|
|
<td class="paramname"><em>eta</em> </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 Geometric Functions</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.7.5
|
|
</small></address>
|
|
|
|
</body>
|
|
</html>
|