aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03303.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/a03303.html516
1 files changed, 516 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03303.html b/docs/doxygen/nel/a03303.html
new file mode 100644
index 00000000..10503b83
--- /dev/null
+++ b/docs/doxygen/nel/a03303.html
@@ -0,0 +1,516 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>NeL: NLMISC::CRandomGrid3D class Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.6 -->
+<div class="qindex"> <form class="search" action="search.php" method="get">
+<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
+<h1>NLMISC::CRandomGrid3D Class Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
+A static 3D array of random value + other infos for noise.
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00049">49</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.<table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Da0">CRandomGrid3D</a> ()</td></tr>
+
+<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3De0">evalBiLinear</a> (const <a class="el" href="a03128.html">CVector</a> &amp;pos)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3De1">evalNearest</a> (const <a class="el" href="a03128.html">CVector</a> &amp;pos)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3De2">getLevelPhase</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a630">level</a>)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3De3">getLevelSize</a> (<a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a04223.html#a630">level</a>)</td></tr>
+
+<tr><td colspan=2><br><h2>Static Private Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dh0">easeInEaseOut</a> (float &amp;<a class="el" href="a04223.html#a573">y</a>, float <a class="el" href="a04223.html#a572">x</a>)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a> (<a class="el" href="a04558.html#a15">uint</a> ux, <a class="el" href="a04558.html#a15">uint</a> uy, <a class="el" href="a04558.html#a15">uint</a> uz)</td></tr>
+
+<tr><td colspan=2><br><h2>Static Private Attributes</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03128.html">CVector</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">_LevelPhase</a> [3]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dv1">_Sizes</a> [3]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dv2">_Texture3d</a> [(1&lt;&lt; 5)*(1&lt;&lt; 5)*(1&lt;&lt; 5)]</td></tr>
+
+</table>
+<hr><h2>Constructor &amp; Destructor Documentation</h2>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3Da0" doxytag="NLMISC::CRandomGrid3D::CRandomGrid3D" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> NLMISC::CRandomGrid3D::CRandomGrid3D </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00054">54</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a06105.html#l00204">_LevelPhase</a>, <a class="el" href="a06105.html#l00203">_Sizes</a>, <a class="el" href="a06105.html#l00202">_Texture3d</a>, <a class="el" href="a05587.html#l00084">NLMISC::frand()</a>, <a class="el" href="a06105.html#l00040">NL3D_NOISE_GRID_SIZE</a>, <a class="el" href="a06105.html#l00039">NL3D_NOISE_GRID_SIZE_SHIFT</a>, <a class="el" href="a06105.html#l00038">NL3D_NOISE_LEVEL</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05646.html#l00237">v</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, <a class="el" href="a05646.html#l00236">y</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>, and <a class="el" href="a05646.html#l00236">z</a>.
+<p>
+<div class="fragment"><pre>00055 {
+00056 <span class="comment">//seed</span>
+00057 srand(0);
+00058
+00059 <span class="comment">// init the grid</span>
+00060 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a574">z</a>=0; <a class="code" href="a04223.html#a574">z</a>&lt;<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>; <a class="code" href="a04223.html#a574">z</a>++)
+00061 {
+00062 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a573">y</a>=0; <a class="code" href="a04223.html#a573">y</a>&lt;<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>; <a class="code" href="a04223.html#a573">y</a>++)
+00063 {
+00064 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a572">x</a>=0; <a class="code" href="a04223.html#a572">x</a>&lt;<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>; <a class="code" href="a04223.html#a572">x</a>++)
+00065 {
+00066 <a class="code" href="a04558.html#a15">uint</a> <span class="keywordtype">id</span>= <a class="code" href="a04223.html#a572">x</a> + (<a class="code" href="a04223.html#a573">y</a>&lt;&lt;<a class="code" href="a04682.html#a1">NL3D_NOISE_GRID_SIZE_SHIFT</a>) + (<a class="code" href="a04223.html#a574">z</a>&lt;&lt;(<a class="code" href="a04682.html#a1">NL3D_NOISE_GRID_SIZE_SHIFT</a>*2));
+00067 <span class="comment">// take higher bits of rand gives better result.</span>
+00068 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a576">v</a>= rand() &gt;&gt; 5;
+00069 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv2">_Texture3d</a>[<span class="keywordtype">id</span>]= <a class="code" href="a04223.html#a576">v</a>&amp;255;
+00070 }
+00071 }
+00072 }
+00073
+00074 <span class="comment">// init sizes.</span>
+00075 <a class="code" href="a04558.html#a15">uint</a> i;
+00076 <span class="comment">// sum of sizes must be 1, and each level must be /2.</span>
+00077 <span class="keywordtype">float</span> sizeSum=0;
+00078 <span class="keywordflow">for</span>(i=0; i&lt;<a class="code" href="a04682.html#a0">NL3D_NOISE_LEVEL</a>; i++)
+00079 {
+00080 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv1">_Sizes</a>[i]= 1.0f / (1&lt;&lt;i);
+00081 sizeSum+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv1">_Sizes</a>[i];
+00082 }
+00083 <span class="comment">// normalize</span>
+00084 <span class="keywordflow">for</span>(i=0; i&lt;<a class="code" href="a04682.html#a0">NL3D_NOISE_LEVEL</a>; i++)
+00085 {
+00086 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv1">_Sizes</a>[i]/= sizeSum;
+00087 }
+00088
+00089 <span class="comment">// init LevelPhases.</span>
+00090 <span class="keywordflow">for</span>(i=0; i&lt;<a class="code" href="a04682.html#a0">NL3D_NOISE_LEVEL</a>; i++)
+00091 {
+00092 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">_LevelPhase</a>[i].x= <a class="code" href="a05378.html#a371">frand</a>(NL3D_NOISE_GRID_SIZE);
+00093 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">_LevelPhase</a>[i].y= <a class="code" href="a05378.html#a371">frand</a>(NL3D_NOISE_GRID_SIZE);
+00094 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">_LevelPhase</a>[i].z= <a class="code" href="a05378.html#a371">frand</a>(NL3D_NOISE_GRID_SIZE);
+00095 }
+00096 <span class="comment">// not for level 0.</span>
+00097 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">_LevelPhase</a>[0]= CVector::Null;
+00098 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Member Function Documentation</h2>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3Dh0" doxytag="NLMISC::CRandomGrid3D::easeInEaseOut" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void NLMISC::CRandomGrid3D::easeInEaseOut </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">float &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>y</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>float&nbsp;</td>
+ <td class="mdname" nowrap> <em>x</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [inline, static, private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00191">191</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>.
+<p>
+Referenced by <a class="el" href="a06105.html#l00119">evalBiLinear()</a>.
+<p>
+<div class="fragment"><pre>00192 {
+00193 <span class="comment">// cubic such that f(0)=0, f'(0)=0, f(1)=1, f'(1)=0.</span>
+00194 <span class="keywordtype">float</span> x2=<a class="code" href="a04223.html#a572">x</a>*<a class="code" href="a04223.html#a572">x</a>;
+00195 <span class="keywordtype">float</span> x3=x2*<a class="code" href="a04223.html#a572">x</a>;
+00196 <a class="code" href="a04223.html#a573">y</a>= -2*x3 + 3*x2;
+00197 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3De0" doxytag="NLMISC::CRandomGrid3D::evalBiLinear" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NLMISC::CRandomGrid3D::evalBiLinear </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>pos</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline, static]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00119">119</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a06105.html#l00191">easeInEaseOut()</a>, <a class="el" href="a06105.html#l00184">lookup()</a>, <a class="el" href="a06105.html#l00040">NL3D_NOISE_GRID_SIZE</a>, <a class="el" href="a06105.html#l00041">NLMISC::NL3D_OO255</a>, <a class="el" href="a05701.html#l00125">NLMISC::OptFastFloor()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, <a class="el" href="a05646.html#l00236">y</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>, and <a class="el" href="a05646.html#l00236">z</a>.
+<p>
+<div class="fragment"><pre>00120 {
+00121 <span class="comment">// compute integer part.</span>
+00122 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>= <a class="code" href="a05378.html#a397">OptFastFloor</a>(pos.x);
+00123 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a573">y</a>= <a class="code" href="a05378.html#a397">OptFastFloor</a>(pos.y);
+00124 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a574">z</a>= <a class="code" href="a05378.html#a397">OptFastFloor</a>(pos.z);
+00125 <span class="comment">// index in texture.</span>
+00126 <a class="code" href="a04558.html#a15">uint</a> ux= <a class="code" href="a04223.html#a572">x</a>&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00127 <a class="code" href="a04558.html#a15">uint</a> uy= <a class="code" href="a04223.html#a573">y</a>&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00128 <a class="code" href="a04558.html#a15">uint</a> uz= <a class="code" href="a04223.html#a574">z</a>&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00129 <a class="code" href="a04558.html#a15">uint</a> ux2= (<a class="code" href="a04223.html#a572">x</a>+1)&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00130 <a class="code" href="a04558.html#a15">uint</a> uy2= (<a class="code" href="a04223.html#a573">y</a>+1)&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00131 <a class="code" href="a04558.html#a15">uint</a> uz2= (<a class="code" href="a04223.html#a574">z</a>+1)&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00132 <span class="comment">// delta.</span>
+00133 <span class="keywordtype">float</span> dx2;
+00134 <span class="keywordtype">float</span> dy2;
+00135 <span class="keywordtype">float</span> dz2;
+00136 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh0">easeInEaseOut</a>(dx2, pos.x-x);
+00137 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh0">easeInEaseOut</a>(dy2, pos.y-y);
+00138 <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh0">easeInEaseOut</a>(dz2, pos.z-z);
+00139 <span class="keywordtype">float</span> dx= 1-dx2;
+00140 <span class="keywordtype">float</span> dy= 1-dy2;
+00141 <span class="keywordtype">float</span> dz= 1-dz2;
+00142 <span class="comment">// TriLinear in texture3D.</span>
+00143 <span class="keywordtype">float</span> turb=0;
+00144 <span class="keywordtype">float</span> dxdy= dx*dy;
+00145 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux,uy,uz)* dxdy*dz;
+00146 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux,uy,uz2)* dxdy*dz2;
+00147 <span class="keywordtype">float</span> dxdy2= dx*dy2;
+00148 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux,uy2,uz)* dxdy2*dz;
+00149 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux,uy2,uz2)* dxdy2*dz2;
+00150 <span class="keywordtype">float</span> dx2dy= dx2*dy;
+00151 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux2,uy,uz)* dx2dy*dz;
+00152 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux2,uy,uz2)* dx2dy*dz2;
+00153 <span class="keywordtype">float</span> dx2dy2= dx2*dy2;
+00154 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux2,uy2,uz)* dx2dy2*dz;
+00155 turb+= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux2,uy2,uz2)* dx2dy2*dz2;
+00156
+00157 <span class="comment">// End!</span>
+00158 <span class="keywordflow">return</span> turb*<a class="code" href="a05378.html#a29">NL3D_OO255</a>;
+00159 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3De1" doxytag="NLMISC::CRandomGrid3D::evalNearest" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NLMISC::CRandomGrid3D::evalNearest </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>pos</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline, static]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00101">101</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a06105.html#l00184">lookup()</a>, <a class="el" href="a06105.html#l00040">NL3D_NOISE_GRID_SIZE</a>, <a class="el" href="a06105.html#l00041">NLMISC::NL3D_OO255</a>, <a class="el" href="a05701.html#l00125">NLMISC::OptFastFloor()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>, <a class="el" href="a05646.html#l00236">y</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::z</a>, and <a class="el" href="a05646.html#l00236">z</a>.
+<p>
+<div class="fragment"><pre>00102 {
+00103 <span class="comment">// compute integer part.</span>
+00104 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>= <a class="code" href="a05378.html#a397">OptFastFloor</a>(pos.x);
+00105 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a573">y</a>= <a class="code" href="a05378.html#a397">OptFastFloor</a>(pos.y);
+00106 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a574">z</a>= <a class="code" href="a05378.html#a397">OptFastFloor</a>(pos.z);
+00107 <span class="comment">// index in texture.</span>
+00108 <a class="code" href="a04558.html#a15">uint</a> ux= <a class="code" href="a04223.html#a572">x</a>&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00109 <a class="code" href="a04558.html#a15">uint</a> uy= <a class="code" href="a04223.html#a573">y</a>&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00110 <a class="code" href="a04558.html#a15">uint</a> uz= <a class="code" href="a04223.html#a574">z</a>&amp; (<a class="code" href="a04682.html#a2">NL3D_NOISE_GRID_SIZE</a>-1);
+00111
+00112 <span class="comment">// read the texture.</span>
+00113 <span class="keywordtype">float</span> turb= <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dh1">lookup</a>(ux,uy,uz);
+00114
+00115 <span class="keywordflow">return</span> turb*<a class="code" href="a05378.html#a29">NL3D_OO255</a>;
+00116 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3De2" doxytag="NLMISC::CRandomGrid3D::getLevelPhase" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> const <a class="el" href="a03128.html">CVector</a>&amp; NLMISC::CRandomGrid3D::getLevelPhase </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>level</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline, static]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00169">169</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a06105.html#l00204">_LevelPhase</a>, <a class="el" href="a05646.html#l01013">level</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+<div class="fragment"><pre>00170 {
+00171 <span class="keywordflow">return</span> <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">_LevelPhase</a>[<a class="code" href="a04223.html#a630">level</a>];
+00172 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3De3" doxytag="NLMISC::CRandomGrid3D::getLevelSize" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NLMISC::CRandomGrid3D::getLevelSize </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>level</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap><code> [inline, static]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00163">163</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a06105.html#l00203">_Sizes</a>, <a class="el" href="a05646.html#l01013">level</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+<div class="fragment"><pre>00164 {
+00165 <span class="keywordflow">return</span> <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv1">_Sizes</a>[<a class="code" href="a04223.html#a630">level</a>];
+00166 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3Dh1" doxytag="NLMISC::CRandomGrid3D::lookup" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float NLMISC::CRandomGrid3D::lookup </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>ux</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>uy</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>uz</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"><code> [inline, static, private]</code></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00184">184</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+References <a class="el" href="a06105.html#l00202">_Texture3d</a>, <a class="el" href="a06105.html#l00039">NL3D_NOISE_GRID_SIZE_SHIFT</a>, and <a class="el" href="a05981.html#l00105">uint</a>.
+<p>
+Referenced by <a class="el" href="a06105.html#l00119">evalBiLinear()</a>, and <a class="el" href="a06105.html#l00101">evalNearest()</a>.
+<p>
+<div class="fragment"><pre>00185 {
+00186 <a class="code" href="a04558.html#a15">uint</a> <span class="keywordtype">id</span>= ux + (uy&lt;&lt;<a class="code" href="a04682.html#a1">NL3D_NOISE_GRID_SIZE_SHIFT</a>) + (uz&lt;&lt;(<a class="code" href="a04682.html#a1">NL3D_NOISE_GRID_SIZE_SHIFT</a>*2));
+00187 <span class="keywordflow">return</span> <a class="code" href="a03303.html#NLMISC_1_1CRandomGrid3Dv2">_Texture3d</a>[<span class="keywordtype">id</span>];
+00188 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Field Documentation</h2>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3Dv0" doxytag="NLMISC::CRandomGrid3D::_LevelPhase" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a03128.html">CVector</a> <a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dv0">NLMISC::CRandomGrid3D::_LevelPhase</a><code> [static, private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00204">204</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06105.html#l00054">CRandomGrid3D()</a>, and <a class="el" href="a06105.html#l00169">getLevelPhase()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3Dv1" doxytag="NLMISC::CRandomGrid3D::_Sizes" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> float <a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dv1">NLMISC::CRandomGrid3D::_Sizes</a><code> [static, private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00203">203</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06105.html#l00054">CRandomGrid3D()</a>, and <a class="el" href="a06105.html#l00163">getLevelSize()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="NLMISC_1_1CRandomGrid3Dv2" doxytag="NLMISC::CRandomGrid3D::_Texture3d" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a> <a class="el" href="a03303.html#NLMISC_1_1CRandomGrid3Dv2">NLMISC::CRandomGrid3D::_Texture3d</a><code> [static, private]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06105.html#l00202">202</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06105.html#l00054">CRandomGrid3D()</a>, and <a class="el" href="a06105.html#l00184">lookup()</a>. </td>
+ </tr>
+</table>
+<hr>The documentation for this class was generated from the following file:<ul>
+<li><a class="el" href="a06105.html">noise_value.cpp</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:31:04 2004 for NeL by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.6 </small></address>
+</body>
+</html>