00001 // This file may be redistributed and modified only under the terms of 00002 // the GNU General Public License (See COPYING for details). 00003 // Copyright (C) 2003 Damien McGinnes, Alistair Riddoch 00004 00005 #ifndef MERCATOR_BASE_POINT_H 00006 #define MERCATOR_BASE_POINT_H 00007 00008 #include <iostream> 00009 00010 namespace Mercator { 00011 00019 class BasePoint { 00020 private: 00022 float m_height; 00024 float m_roughness; 00026 float m_falloff; 00027 00028 public: 00030 static const float HEIGHT; 00032 static const float ROUGHNESS; 00034 static const float FALLOFF; 00035 00041 explicit BasePoint(float h = HEIGHT, 00042 float r = ROUGHNESS, 00043 float f = FALLOFF) : 00044 m_height(h), m_roughness(r), m_falloff(f) {} 00045 00047 const float height() const { return m_height; } 00049 float & height() { return m_height; } 00050 00052 const float roughness() const { return m_roughness; } 00054 float & roughness() { return m_roughness; } 00055 00057 const float falloff() const { return m_falloff; } 00059 float & falloff() { return m_falloff; } 00060 00062 unsigned int seed() const { return (unsigned int)(m_height * 1000.0);} 00063 }; 00064 00065 } //namespace Mercator 00066 00067 #endif // MERCATOR_BASE_POINT_H