<!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>Mercator: BasePoint.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Mercator</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">BasePoint.h</div> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This file may be redistributed and modified only under the terms of</span> <a name="l00002"></a>00002 <span class="comment">// the GNU General Public License (See COPYING for details).</span> <a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2003 Damien McGinnes, Alistair Riddoch</span> <a name="l00004"></a>00004 <a name="l00005"></a>00005 <span class="preprocessor">#ifndef MERCATOR_BASE_POINT_H</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define MERCATOR_BASE_POINT_H</span> <a name="l00007"></a>00007 <span class="preprocessor"></span> <a name="l00008"></a>00008 <span class="preprocessor">#include <iostream></span> <a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="keyword">namespace </span>Mercator { <a name="l00011"></a>00011 <a name="l00019"></a><a class="code" href="classMercator_1_1BasePoint.html">00019</a> <span class="keyword">class </span><a class="code" href="classMercator_1_1BasePoint.html" title="Point on the fundamental grid that is used as the basis for terrain.">BasePoint</a> { <a name="l00020"></a>00020 <span class="keyword">private</span>: <a name="l00022"></a><a class="code" href="classMercator_1_1BasePoint.html#a6d371a9676d73f928347be68da1f8488">00022</a> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a6d371a9676d73f928347be68da1f8488" title="The height at the base point.">m_height</a>; <a name="l00024"></a><a class="code" href="classMercator_1_1BasePoint.html#a351e22d1f6e0772e5a017680ebd3e313">00024</a> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a351e22d1f6e0772e5a017680ebd3e313" title="The roughness at the base point.">m_roughness</a>; <a name="l00026"></a><a class="code" href="classMercator_1_1BasePoint.html#ad5e4dd8cec302b2c5d9b4ae3e024a449">00026</a> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#ad5e4dd8cec302b2c5d9b4ae3e024a449" title="The falloff at the base point.">m_falloff</a>; <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="keyword">public</span>: <a name="l00030"></a><a class="code" href="classMercator_1_1BasePoint.html#a75ea29975e41decd1d28910c860b9c7c">00030</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a75ea29975e41decd1d28910c860b9c7c" title="Default height at the base point.">HEIGHT</a>; <a name="l00032"></a><a class="code" href="classMercator_1_1BasePoint.html#a4cba8bcf0560a5dc44676d57b482b7d6">00032</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a4cba8bcf0560a5dc44676d57b482b7d6" title="Default roughness at the base point.">ROUGHNESS</a>; <a name="l00034"></a><a class="code" href="classMercator_1_1BasePoint.html#ac6fea8de72cf7f30d993e2a7b55cf603">00034</a> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#ac6fea8de72cf7f30d993e2a7b55cf603" title="Default falloff at the base point.">FALLOFF</a>; <a name="l00035"></a>00035 <a name="l00041"></a><a class="code" href="classMercator_1_1BasePoint.html#acb0738f587daed82d0eee6a9ccc3d98a">00041</a> <span class="keyword">explicit</span> <a class="code" href="classMercator_1_1BasePoint.html#acb0738f587daed82d0eee6a9ccc3d98a" title="Constructor.">BasePoint</a>(<span class="keywordtype">float</span> h = <a class="code" href="classMercator_1_1BasePoint.html#a75ea29975e41decd1d28910c860b9c7c" title="Default height at the base point.">HEIGHT</a>, <a name="l00042"></a>00042 <span class="keywordtype">float</span> r = <a class="code" href="classMercator_1_1BasePoint.html#a4cba8bcf0560a5dc44676d57b482b7d6" title="Default roughness at the base point.">ROUGHNESS</a>, <a name="l00043"></a>00043 <span class="keywordtype">float</span> f = <a class="code" href="classMercator_1_1BasePoint.html#ac6fea8de72cf7f30d993e2a7b55cf603" title="Default falloff at the base point.">FALLOFF</a>) : <a name="l00044"></a>00044 <a class="code" href="classMercator_1_1BasePoint.html#a6d371a9676d73f928347be68da1f8488" title="The height at the base point.">m_height</a>(h), <a class="code" href="classMercator_1_1BasePoint.html#a351e22d1f6e0772e5a017680ebd3e313" title="The roughness at the base point.">m_roughness</a>(r), <a class="code" href="classMercator_1_1BasePoint.html#ad5e4dd8cec302b2c5d9b4ae3e024a449" title="The falloff at the base point.">m_falloff</a>(f) {} <a name="l00045"></a>00045 <a name="l00047"></a><a class="code" href="classMercator_1_1BasePoint.html#a3f742e08daa4aa5d74480f582b708240">00047</a> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a3f742e08daa4aa5d74480f582b708240" title="Accessor for the height at the base point.">height</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1BasePoint.html#a6d371a9676d73f928347be68da1f8488" title="The height at the base point.">m_height</a>; } <a name="l00049"></a><a class="code" href="classMercator_1_1BasePoint.html#afd06990a536cf5b7beb752aef72f64d4">00049</a> <span class="keywordtype">float</span> & <a class="code" href="classMercator_1_1BasePoint.html#afd06990a536cf5b7beb752aef72f64d4" title="Accessor for the height at the base point.">height</a>() { <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1BasePoint.html#a6d371a9676d73f928347be68da1f8488" title="The height at the base point.">m_height</a>; } <a name="l00050"></a>00050 <a name="l00052"></a><a class="code" href="classMercator_1_1BasePoint.html#a8f2d0b4c91d0abedf6ccb17d7a3b3547">00052</a> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a8f2d0b4c91d0abedf6ccb17d7a3b3547" title="Accessor for the roughness at the base point.">roughness</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1BasePoint.html#a351e22d1f6e0772e5a017680ebd3e313" title="The roughness at the base point.">m_roughness</a>; } <a name="l00054"></a><a class="code" href="classMercator_1_1BasePoint.html#a87074a8e4cd81cd53245ff63739836b9">00054</a> <span class="keywordtype">float</span> & <a class="code" href="classMercator_1_1BasePoint.html#a87074a8e4cd81cd53245ff63739836b9" title="Accessor for the roughness at the base point.">roughness</a>() { <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1BasePoint.html#a351e22d1f6e0772e5a017680ebd3e313" title="The roughness at the base point.">m_roughness</a>; } <a name="l00055"></a>00055 <a name="l00057"></a><a class="code" href="classMercator_1_1BasePoint.html#a1cd9349c213a54d4c11fa42278540aff">00057</a> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="classMercator_1_1BasePoint.html#a1cd9349c213a54d4c11fa42278540aff" title="Accessor for the falloff at the base point.">falloff</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1BasePoint.html#ad5e4dd8cec302b2c5d9b4ae3e024a449" title="The falloff at the base point.">m_falloff</a>; } <a name="l00059"></a><a class="code" href="classMercator_1_1BasePoint.html#ad559546ddf37cad56b510089f88672e4">00059</a> <span class="keywordtype">float</span> & <a class="code" href="classMercator_1_1BasePoint.html#ad559546ddf37cad56b510089f88672e4" title="Accessor for the falloff at the base point.">falloff</a>() { <span class="keywordflow">return</span> <a class="code" href="classMercator_1_1BasePoint.html#ad5e4dd8cec302b2c5d9b4ae3e024a449" title="The falloff at the base point.">m_falloff</a>; } <a name="l00060"></a>00060 <a name="l00062"></a><a class="code" href="classMercator_1_1BasePoint.html#a479a70faeca80d1686a3fe273bf87507">00062</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classMercator_1_1BasePoint.html#a479a70faeca80d1686a3fe273bf87507" title="Calculate the random seed used at this base point.">seed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)(<a class="code" href="classMercator_1_1BasePoint.html#a6d371a9676d73f928347be68da1f8488" title="The height at the base point.">m_height</a> * 1000.0);} <a name="l00063"></a>00063 }; <a name="l00064"></a>00064 <a name="l00065"></a>00065 } <span class="comment">//namespace Mercator</span> <a name="l00066"></a>00066 <a name="l00067"></a>00067 <span class="preprocessor">#endif // MERCATOR_BASE_POINT_H</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated for Mercator by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>