Mercator
BasePoint.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU General Public License (See COPYING for details).
3 // Copyright (C) 2003 Damien McGinnes, Alistair Riddoch
4 
5 #ifndef MERCATOR_BASE_POINT_H
6 #define MERCATOR_BASE_POINT_H
7 
8 #include <iostream>
9 
10 namespace Mercator {
11 
19 class BasePoint {
20  private:
22  float m_height;
24  float m_roughness;
26  float m_falloff;
27 
28  public:
30  static const float HEIGHT;
32  static const float ROUGHNESS;
34  static const float FALLOFF;
35 
41  explicit BasePoint(float h = HEIGHT,
42  float r = ROUGHNESS,
43  float f = FALLOFF) :
44  m_height(h), m_roughness(r), m_falloff(f) {}
45 
47  const float height() const { return m_height; }
49  float & height() { return m_height; }
50 
52  const float roughness() const { return m_roughness; }
54  float & roughness() { return m_roughness; }
55 
57  const float falloff() const { return m_falloff; }
59  float & falloff() { return m_falloff; }
60 
62  //unsigned int seed() const { return (unsigned int)(m_height * 1000.0);}
63  unsigned int seed() const;
64 };
65 
66 } //namespace Mercator
67 
68 #endif // MERCATOR_BASE_POINT_H
const float falloff() const
Accessor for the falloff at the base point.
Definition: BasePoint.h:57
float & height()
Accessor for the height at the base point.
Definition: BasePoint.h:49
Definition: Area.cpp:20
float & roughness()
Accessor for the roughness at the base point.
Definition: BasePoint.h:54
static const float FALLOFF
Default falloff at the base point.
Definition: BasePoint.h:34
static const float HEIGHT
Default height at the base point.
Definition: BasePoint.h:30
static const float ROUGHNESS
Default roughness at the base point.
Definition: BasePoint.h:32
const float roughness() const
Accessor for the roughness at the base point.
Definition: BasePoint.h:52
float & falloff()
Accessor for the falloff at the base point.
Definition: BasePoint.h:59
BasePoint(float h=HEIGHT, float r=ROUGHNESS, float f=FALLOFF)
Constructor.
Definition: BasePoint.h:41
Point on the fundamental grid that is used as the basis for terrain.
Definition: BasePoint.h:19
float m_height
The height at the base point.
Definition: BasePoint.h:22
float m_roughness
The roughness at the base point.
Definition: BasePoint.h:24
const float height() const
Accessor for the height at the base point.
Definition: BasePoint.h:47
unsigned int seed() const
Calculate the random seed used at this base point.
Definition: Segment.cpp:26
float m_falloff
The falloff at the base point.
Definition: BasePoint.h:26