diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02990.html | 457 |
1 files changed, 457 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02990.html b/docs/doxygen/nel/a02990.html new file mode 100644 index 00000000..d3114603 --- /dev/null +++ b/docs/doxygen/nel/a02990.html @@ -0,0 +1,457 @@ +<!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::CNoiseValue 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 Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CNoiseValue Class Reference</h1><code>#include <<a class="el" href="a06106.html">noise_value.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A class which generate noisy value, according to a position <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06106.html#l00049">49</a> of file <a class="el" href="a06106.html">noise_value.h</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> </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValuea0">CNoiseValue</a> (float abs, float rand, float freq)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValuea1">CNoiseValue</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Default to 0, 1, 1. <a href="#NLMISC_1_1CNoiseValuea1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValuea2">eval</a> (const <a class="el" href="a03128.html">CVector</a> &posInWorld) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValuea3">evalOneLevelRandom</a> (const <a class="el" href="a03128.html">CVector</a> &posInWorld) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValuea4">serial</a> (<a class="el" href="a02270.html">IStream</a> &f)</td></tr> + +<tr><td colspan=2><br><h2>Data Fields</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValueo0">Abs</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValueo1">Frequency</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValueo2">Rand</a></td></tr> + +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValued0">evalRandom</a> (const <a class="el" href="a03128.html">CVector</a> &pos) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a02990.html#NLMISC_1_1CNoiseValued1">noise</a> (const <a class="el" href="a03128.html">CVector</a> &pos) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">pos scale is in [0..1] <a href="#NLMISC_1_1CNoiseValued1"></a><br><br></td></tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CNoiseValuea1" doxytag="NLMISC::CNoiseValue::CNoiseValue" ></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::CNoiseValue::CNoiseValue </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Default to 0, 1, 1. +<p> + +<p> +Definition at line <a class="el" href="a06105.html#l00258">258</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +<div class="fragment"><pre>00259 { +00260 <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo0">Abs</a>= 0; +00261 <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo2">Rand</a>= 1; +00262 <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo1">Frequency</a>= 1; +00263 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValuea0" doxytag="NLMISC::CNoiseValue::CNoiseValue" ></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::CNoiseValue::CNoiseValue </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname" nowrap> <em>abs</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>rand</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>freq</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06105.html#l00267">267</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +<div class="fragment"><pre>00268 { +00269 <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo0">Abs</a>= abs; +00270 <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo2">Rand</a>= rand; +00271 <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo1">Frequency</a>= freq; +00272 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CNoiseValuea2" doxytag="NLMISC::CNoiseValue::eval" ></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::CNoiseValue::eval </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>posInWorld</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return Abs + Rand* noise(Pos*Frequency). with <a class="el" href="a02990.html#NLMISC_1_1CNoiseValued1">noise()</a> E [0..1]. Warning! Use <a class="el" href="a05378.html#a397">OptFastFloor()</a>! So call must be enclosed with a <a class="el" href="a05378.html#a395">OptFastFloorBegin()</a>/OptFastFloorEnd(). +<p> +Definition at line <a class="el" href="a06105.html#l00276">276</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +References <a class="el" href="a06105.html#l00223">noise()</a>. +<p> +Referenced by <a class="el" href="a06105.html#l00309">NLMISC::CNoiseColorGradient::eval()</a>, <a class="el" href="a06686.html#l00176">NL3D::CVegetable::generateGroup()</a>, <a class="el" href="a06686.html#l00190">NL3D::CVegetable::generateGroupBiLinear()</a>, and <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>. +<p> +<div class="fragment"><pre>00277 { +00278 <span class="comment">// A single cube in the Grid3d correspond to Frequency==1.</span> +00279 <span class="comment">// So enlarging size of the grid3d do not affect the frequency aspect.</span> +00280 <span class="keywordflow">return</span> <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo0">Abs</a> + <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo2">Rand</a> * <a class="code" href="a02990.html#NLMISC_1_1CNoiseValued1">noise</a>(posInWorld*Frequency); +00281 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValuea3" doxytag="NLMISC::CNoiseValue::evalOneLevelRandom" ></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::CNoiseValue::evalOneLevelRandom </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>posInWorld</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +same as eval, but eval just one random level for <a class="el" href="a02990.html#NLMISC_1_1CNoiseValued1">noise()</a> => act much more like a random. Warning! Use <a class="el" href="a05378.html#a397">OptFastFloor()</a>! So call must be enclosed with a <a class="el" href="a05378.html#a395">OptFastFloorBegin()</a>/OptFastFloorEnd(). +<p> +Definition at line <a class="el" href="a06105.html#l00285">285</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +References <a class="el" href="a06105.html#l00216">evalRandom()</a>. +<p> +Referenced by <a class="el" href="a06686.html#l00190">NL3D::CVegetable::generateGroupBiLinear()</a>, and <a class="el" href="a06686.html#l00132">NL3D::CVegetable::generateGroupEx()</a>. +<p> +<div class="fragment"><pre>00286 { +00287 <span class="comment">// A single cube in the Grid3d correspond to Frequency==1.</span> +00288 <span class="comment">// So enlarging size of the grid3d do not affect the frequency aspect.</span> +00289 <span class="keywordflow">return</span> <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo0">Abs</a> + <a class="code" href="a02990.html#NLMISC_1_1CNoiseValueo2">Rand</a> * <a class="code" href="a02990.html#NLMISC_1_1CNoiseValued0">evalRandom</a>(posInWorld*Frequency); +00290 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValued0" doxytag="NLMISC::CNoiseValue::evalRandom" ></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::CNoiseValue::evalRandom </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>pos</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06105.html#l00216">216</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +Referenced by <a class="el" href="a06105.html#l00285">evalOneLevelRandom()</a>. +<p> +<div class="fragment"><pre>00217 { +00218 <span class="keywordflow">return</span> CRandomGrid3D::evalNearest(pos); +00219 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValued1" doxytag="NLMISC::CNoiseValue::noise" ></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::CNoiseValue::noise </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>pos</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +pos scale is in [0..1] +<p> + +<p> +Definition at line <a class="el" href="a06105.html#l00223">223</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +References <a class="el" href="a05646.html#l01013">level</a>, <a class="el" href="a06105.html#l00038">NL3D_NOISE_LEVEL</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06105.html#l00276">eval()</a>. +<p> +<div class="fragment"><pre>00224 { +00225 <span class="comment">// eval "fractaly".</span> +00226 <span class="keywordtype">float</span> turb; +00227 +00228 <span class="preprocessor">#if (NL3D_NOISE_LEVEL != 3)</span> +00229 <span class="preprocessor"></span> CVector vd= pos; +00230 turb=0; +00231 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a630">level</a>=0;<a class="code" href="a04223.html#a630">level</a><<a class="code" href="a04682.html#a0">NL3D_NOISE_LEVEL</a>;<a class="code" href="a04223.html#a630">level</a>++) +00232 { +00233 <span class="comment">// Add the influence of the ith level.</span> +00234 turb+= CRandomGrid3D::getLevelSize(level) * +00235 CRandomGrid3D::evalBiLinear(vd + CRandomGrid3D::getLevelPhase(level) ); +00236 <span class="comment">// Next level at higher frequency</span> +00237 vd*= 2; +00238 } +00239 <span class="preprocessor">#else</span> +00240 <span class="preprocessor"></span> <span class="comment">// special case. unrolled loop.</span> +00241 <span class="comment">// level 0 has no phase.</span> +00242 turb= CRandomGrid3D::getLevelSize(0) * +00243 CRandomGrid3D::evalBiLinear(pos); +00244 <span class="comment">// level 1</span> +00245 turb+= CRandomGrid3D::getLevelSize(1) * +00246 CRandomGrid3D::evalBiLinear(pos*2 + CRandomGrid3D::getLevelPhase(1) ); +00247 <span class="comment">// level 2</span> +00248 turb+= CRandomGrid3D::getLevelSize(2) * +00249 CRandomGrid3D::evalBiLinear(pos*4 + CRandomGrid3D::getLevelPhase(2) ); +00250 <span class="preprocessor">#endif</span> +00251 <span class="preprocessor"></span> +00252 <span class="keywordflow">return</span> turb; +00253 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValuea4" doxytag="NLMISC::CNoiseValue::serial" ></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::CNoiseValue::serial </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02270.html">IStream</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>f</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06105.html#l00294">294</a> of file <a class="el" href="a06105.html">noise_value.cpp</a>. +<p> +References <a class="el" href="a06462.html#l00232">NLMISC::IStream::serial()</a>, and <a class="el" href="a06461.html#l00266">NLMISC::IStream::serialVersion()</a>. +<p> +<div class="fragment"><pre>00295 { +00296 (<span class="keywordtype">void</span>)f.serialVersion(0); +00297 f.serial(Abs); +00298 f.serial(Rand); +00299 f.serial(Frequency); +00300 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CNoiseValueo0" doxytag="NLMISC::CNoiseValue::Abs" ></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="a02990.html#NLMISC_1_1CNoiseValueo0">NLMISC::CNoiseValue::Abs</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06106.html#l00052">52</a> of file <a class="el" href="a06106.html">noise_value.h</a>. +<p> +Referenced by <a class="el" href="a06686.html#l00048">NL3D::CVegetable::CVegetable()</a>, and <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValueo1" doxytag="NLMISC::CNoiseValue::Frequency" ></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="a02990.html#NLMISC_1_1CNoiseValueo1">NLMISC::CNoiseValue::Frequency</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06106.html#l00054">54</a> of file <a class="el" href="a06106.html">noise_value.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CNoiseValueo2" doxytag="NLMISC::CNoiseValue::Rand" ></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="a02990.html#NLMISC_1_1CNoiseValueo2">NLMISC::CNoiseValue::Rand</a> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06106.html#l00053">53</a> of file <a class="el" href="a06106.html">noise_value.h</a>. +<p> +Referenced by <a class="el" href="a06686.html#l00048">NL3D::CVegetable::CVegetable()</a>, and <a class="el" href="a06686.html#l00306">NL3D::CVegetable::generateInstance()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06106.html">noise_value.h</a><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:23:30 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> |