glm/doc/html/a00127.html

578 lines
31 KiB
HTML
Raw Normal View History

2010-04-29 10:54:07 +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>GLM: glm::core::function::common Namespace Reference</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.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="namespaces.html"><span>Namespace&nbsp;List</span></a></li>
<li><a href="namespacemembers.html"><span>Namespace&nbsp;Members</span></a></li>
</ul>
</div>
<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="a00127.html">common</a>
</div>
</div>
<div class="contents">
<h1>glm::core::function::common Namespace Reference</h1>
<p>Define <a class="el" href="a00127.html" title="Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in...">common</a> functions from Section 8.3 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.
<a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genFIType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genFIType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a5206aa60ce61ad1d7d1b53d5028c7a2a">abs</a> (genFIType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns x if x &gt;= 0; otherwise, it returns -x. <a href="#a5206aa60ce61ad1d7d1b53d5028c7a2a"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a828376ee58b02d80d91eee97c50323f8">ceil</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a value equal to the nearest integer that is greater than or equal to x. <a href="#a828376ee58b02d80d91eee97c50323f8"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genUIFTypeT , typename genUIFTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genUIFTypeT&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#acd376ba065150520e259c71f566fe189">clamp</a> (genUIFTypeT const &amp;x, genUIFTypeU const &amp;minVal, genUIFTypeU const &amp;maxVal)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns min(max(x, minVal), maxVal) for each component in x. <a href="#acd376ba065150520e259c71f566fe189"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a4206a98e812c2bd4801e4d299c83f6c7">floor</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a value equal to the nearest integer that is less then or equal to x. <a href="#a4206a98e812c2bd4801e4d299c83f6c7"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a67dda5fd839bc489827be9e225847a45">fract</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return x - floor(x). <a href="#a67dda5fd839bc489827be9e225847a45"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::bool_type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a7194c89cf656614f231e11c46d906465">isinf</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations. <a href="#a7194c89cf656614f231e11c46d906465"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType::bool_type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a873db92807cc955cf98030c94a342d5a">isnan</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations. <a href="#a873db92807cc955cf98030c94a342d5a"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genUIFTypeT , typename genUIFTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genUIFTypeT&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a56d70a4be287f0dfd43ccb3c004226ea">max</a> (genUIFTypeT const &amp;x, genUIFTypeU const &amp;y)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns y if x &lt; y; otherwise, it returns x. <a href="#a56d70a4be287f0dfd43ccb3c004226ea"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genUIFTypeT , typename genUIFTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genUIFTypeT&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a294d187c6a1fc420aedcec9380660244">min</a> (genUIFTypeT const &amp;x, genUIFTypeU const &amp;y)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns y if y &lt; x; otherwise, it returns x. <a href="#a294d187c6a1fc420aedcec9380660244"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genTypeT , typename genTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genTypeT&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a11288dc43a2a1833766728a3eb81ac63">mix</a> (genTypeT const &amp;x, genTypeT const &amp;y, genTypeU const &amp;a)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genTypeT , typename genTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genTypeT&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#aa2c0e987e6af82b8088aea0f8d30a9ab">mod</a> (genTypeT const &amp;x, genTypeU const &amp;y)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Modulus. <a href="#aa2c0e987e6af82b8088aea0f8d30a9ab"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a3f3cec79cc1542950cd4cddb7ab67584">modf</a> (genType const &amp;x, genType &amp;i)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the fractional part of x and sets i to the integer part (as a whole number floating point value). <a href="#a3f3cec79cc1542950cd4cddb7ab67584"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#aa4cb0836cd9457ac6cedd3366333b16f">round</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a value equal to the nearest integer to x. <a href="#aa4cb0836cd9457ac6cedd3366333b16f"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a656ce625ba1dc1d137bfc7cc7b2ab50b">roundEven</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a value equal to the nearest integer to x. <a href="#a656ce625ba1dc1d137bfc7cc7b2ab50b"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genFIType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genFIType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a992a45e46af5dc123e688808d1bae48f">sign</a> (genFIType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns 1.0 if x &gt; 0, 0.0 if x = 0, or -1.0 if x &lt; 0. <a href="#a992a45e46af5dc123e688808d1bae48f"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genTypeT , typename genTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genTypeU&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#ab10c5116b5fd9c57fd663fa92777d26f">smoothstep</a> (genTypeT const &amp;edge0, genTypeT const &amp;edge1, genTypeU const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns 0.0 if x &lt;= edge0 and 1.0 if x &gt;= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 &lt; x &lt; edge1. <a href="#ab10c5116b5fd9c57fd663fa92777d26f"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genTypeT , typename genTypeU &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genTypeU&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#af2461174c6e77fa69aa8da4eb63e7065">step</a> (genTypeT const &amp;edge, genTypeU const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns 0.0 if x &lt; edge, otherwise it returns 1.0. <a href="#af2461174c6e77fa69aa8da4eb63e7065"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">genType&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00127.html#a2303d814e83b34ee2d5f34fcff7fa275">trunc</a> (genType const &amp;x)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x. <a href="#a2303d814e83b34ee2d5f34fcff7fa275"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Define <a class="el" href="a00127.html" title="Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in...">common</a> functions from Section 8.3 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>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a5206aa60ce61ad1d7d1b53d5028c7a2a"></a><!-- doxytag: member="glm::core::function::common::abs" ref="a5206aa60ce61ad1d7d1b53d5028c7a2a" args="(genFIType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genFIType glm::core::function::common::abs </td>
<td>(</td>
<td class="paramtype">genFIType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns x if x &gt;= 0; otherwise, it returns -x. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a828376ee58b02d80d91eee97c50323f8"></a><!-- doxytag: member="glm::core::function::common::ceil" ref="a828376ee58b02d80d91eee97c50323f8" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::ceil </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a value equal to the nearest integer that is greater than or equal to x. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="acd376ba065150520e259c71f566fe189"></a><!-- doxytag: member="glm::core::function::common::clamp" ref="acd376ba065150520e259c71f566fe189" args="(genUIFTypeT const &amp;x, genUIFTypeU const &amp;minVal, genUIFTypeU const &amp;maxVal)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genUIFTypeT glm::core::function::common::clamp </td>
<td>(</td>
<td class="paramtype">genUIFTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genUIFTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>minVal</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genUIFTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>maxVal</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns min(max(x, minVal), maxVal) for each component in x. </p>
<p>using the floating-point values minVal and maxVal. (From GLSL 1.30.08 specification, section 8.3) </p>
<p>Referenced by <a class="el" href="a00011_source.html#l00048">glm::gtx::compatibility::saturate()</a>.</p>
</div>
</div>
<a class="anchor" id="a4206a98e812c2bd4801e4d299c83f6c7"></a><!-- doxytag: member="glm::core::function::common::floor" ref="a4206a98e812c2bd4801e4d299c83f6c7" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::floor </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a value equal to the nearest integer that is less then or equal to x. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a67dda5fd839bc489827be9e225847a45"></a><!-- doxytag: member="glm::core::function::common::fract" ref="a67dda5fd839bc489827be9e225847a45" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::fract </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return x - floor(x). </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a7194c89cf656614f231e11c46d906465"></a><!-- doxytag: member="glm::core::function::common::isinf" ref="a7194c89cf656614f231e11c46d906465" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType::bool_type glm::core::function::common::isinf </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if x holds a positive infinity or negative infinity representation in the underlying implementation's set of floating point representations. </p>
<p>Returns false otherwise, including for implementations with no infinity representations. (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a873db92807cc955cf98030c94a342d5a"></a><!-- doxytag: member="glm::core::function::common::isnan" ref="a873db92807cc955cf98030c94a342d5a" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType::bool_type glm::core::function::common::isnan </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of floating point representations. </p>
<p>Returns false otherwise, including for implementations with no NaN representations. (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a56d70a4be287f0dfd43ccb3c004226ea"></a><!-- doxytag: member="glm::core::function::common::max" ref="a56d70a4be287f0dfd43ccb3c004226ea" args="(genUIFTypeT const &amp;x, genUIFTypeU const &amp;y)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genUIFTypeT glm::core::function::common::max </td>
<td>(</td>
<td class="paramtype">genUIFTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genUIFTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>y</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns y if x &lt; y; otherwise, it returns x. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a294d187c6a1fc420aedcec9380660244"></a><!-- doxytag: member="glm::core::function::common::min" ref="a294d187c6a1fc420aedcec9380660244" args="(genUIFTypeT const &amp;x, genUIFTypeU const &amp;y)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genUIFTypeT glm::core::function::common::min </td>
<td>(</td>
<td class="paramtype">genUIFTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genUIFTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>y</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns y if y &lt; x; otherwise, it returns x. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a11288dc43a2a1833766728a3eb81ac63"></a><!-- doxytag: member="glm::core::function::common::mix" ref="a11288dc43a2a1833766728a3eb81ac63" args="(genTypeT const &amp;x, genTypeT const &amp;y, genTypeU const &amp;a)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genTypeT glm::core::function::common::mix </td>
<td>(</td>
<td class="paramtype">genTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>y</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>a</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1].</dd>
<dd>
If genTypeU is a boolean scalar or vector: Selects which vector each returned component comes from. For a component of a that is false, the corresponding component of x is returned. For a component of a that is true, the corresponding component of y is returned. Components of x and y that are not selected are allowed to be invalid floating point values and will have no effect on the results. Thus, this provides different functionality than genType mix(genType x, genType y, genType(a)) where a is a Boolean vector.</dd></dl>
<p>From GLSL 1.30.08 specification, section 8.3</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>x</em>&nbsp;</td><td>Floating point scalar or vector. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>y</em>&nbsp;</td><td>Floating point scalar or vector. </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>a</em>&nbsp;</td><td>Floating point or boolean scalar or vector. </td></tr>
</table>
</dd>
</dl>
<p>Referenced by <a class="el" href="a00011_source.html#l00040">glm::gtx::compatibility::lerp()</a>.</p>
</div>
</div>
<a class="anchor" id="aa2c0e987e6af82b8088aea0f8d30a9ab"></a><!-- doxytag: member="glm::core::function::common::mod" ref="aa2c0e987e6af82b8088aea0f8d30a9ab" args="(genTypeT const &amp;x, genTypeU const &amp;y)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genTypeT glm::core::function::common::mod </td>
<td>(</td>
<td class="paramtype">genTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>y</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Modulus. </p>
<p>Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a3f3cec79cc1542950cd4cddb7ab67584"></a><!-- doxytag: member="glm::core::function::common::modf" ref="a3f3cec79cc1542950cd4cddb7ab67584" args="(genType const &amp;x, genType &amp;i)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::modf </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genType &amp;&nbsp;</td>
<td class="paramname"> <em>i</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the fractional part of x and sets i to the integer part (as a whole number floating point value). </p>
<p>Both the return value and the output parameter will have the same sign as x. (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="aa4cb0836cd9457ac6cedd3366333b16f"></a><!-- doxytag: member="glm::core::function::common::round" ref="aa4cb0836cd9457ac6cedd3366333b16f" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::round </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a value equal to the nearest integer to x. </p>
<p>The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest. This includes the possibility that round(x) returns the same value as roundEven(x) for all values of x. (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a656ce625ba1dc1d137bfc7cc7b2ab50b"></a><!-- doxytag: member="glm::core::function::common::roundEven" ref="a656ce625ba1dc1d137bfc7cc7b2ab50b" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::roundEven </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a value equal to the nearest integer to x. </p>
<p>A fractional part of 0.5 will round toward the nearest even integer. (Both 3.5 and 4.5 for x will return 4.0.) (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a992a45e46af5dc123e688808d1bae48f"></a><!-- doxytag: member="glm::core::function::common::sign" ref="a992a45e46af5dc123e688808d1bae48f" args="(genFIType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genFIType glm::core::function::common::sign </td>
<td>(</td>
<td class="paramtype">genFIType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns 1.0 if x &gt; 0, 0.0 if x = 0, or -1.0 if x &lt; 0. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="ab10c5116b5fd9c57fd663fa92777d26f"></a><!-- doxytag: member="glm::core::function::common::smoothstep" ref="ab10c5116b5fd9c57fd663fa92777d26f" args="(genTypeT const &amp;edge0, genTypeT const &amp;edge1, genTypeU const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genTypeU glm::core::function::common::smoothstep </td>
<td>(</td>
<td class="paramtype">genTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>edge0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>edge1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns 0.0 if x &lt;= edge0 and 1.0 if x &gt;= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 &lt; x &lt; edge1. </p>
<p>This is useful in cases where you would want a threshold <a class="el" href="a00126.html" title="Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification...">function</a> with a smooth transition. This is equivalent to: genType t; t = clamp ((x <20> edge0) / (edge1 <20> edge0), 0, 1); return t * t * (3 <20> 2 * t); Results are undefined if edge0 &gt;= edge1. (From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="af2461174c6e77fa69aa8da4eb63e7065"></a><!-- doxytag: member="glm::core::function::common::step" ref="af2461174c6e77fa69aa8da4eb63e7065" args="(genTypeT const &amp;edge, genTypeU const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genTypeU glm::core::function::common::step </td>
<td>(</td>
<td class="paramtype">genTypeT const &amp;&nbsp;</td>
<td class="paramname"> <em>edge</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">genTypeU const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns 0.0 if x &lt; edge, otherwise it returns 1.0. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
<a class="anchor" id="a2303d814e83b34ee2d5f34fcff7fa275"></a><!-- doxytag: member="glm::core::function::common::trunc" ref="a2303d814e83b34ee2d5f34fcff7fa275" args="(genType const &amp;x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">genType glm::core::function::common::trunc </td>
<td>(</td>
<td class="paramtype">genType const &amp;&nbsp;</td>
<td class="paramname"> <em>x</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolute value of x. </p>
<p>(From GLSL 1.30.08 specification, section 8.3) </p>
</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Mon Nov 16 11:23:23 2009 for GLM by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>