mercator 0.4.0
A terrain generation library for the Worldforge system.
|
Point on the fundamental grid that is used as the basis for terrain. More...
#include <BasePoint.h>
Public Member Functions | |
BasePoint (float h=HEIGHT, float r=ROUGHNESS, float f=FALLOFF) | |
Constructor. More... | |
bool | operator== (const BasePoint &rhs) const |
bool | operator!= (const BasePoint &rhs) const |
float | height () const |
Accessor for the height at the base point. More... | |
float & | height () |
Accessor for the height at the base point. More... | |
float | roughness () const |
Accessor for the roughness at the base point. More... | |
float & | roughness () |
Accessor for the roughness at the base point. More... | |
float | falloff () const |
Accessor for the falloff at the base point. More... | |
float & | falloff () |
Accessor for the falloff at the base point. More... | |
unsigned int | seed () const |
Calculate the random seed used at this base point. More... | |
Static Public Attributes | |
static constexpr float | HEIGHT = 8.0 |
Default height at the base point. More... | |
static constexpr float | ROUGHNESS = 1.25 |
Default roughness at the base point. More... | |
static constexpr float | FALLOFF = 0.25 |
Default falloff at the base point. More... | |
Point on the fundamental grid that is used as the basis for terrain.
The terrain is defined by a sparse grid of evenly spaced points, each of which is defined by an instance of this class. The most fundamental property of each point is its elevation stored as height, as this is also used to seed the random number generators. Additional parameters for roughness and falloff are often specified.
Definition at line 19 of file BasePoint.h.
|
inlineexplicit |
Constructor.
h | height at the base point. |
r | roughness at the base point. |
f | falloff at the base point. |
Definition at line 41 of file BasePoint.h.
|
inline |
Accessor for the falloff at the base point.
Definition at line 63 of file BasePoint.h.
|
inline |
Accessor for the falloff at the base point.
Definition at line 61 of file BasePoint.h.
Referenced by Mercator::HeightMap::fill2d().
|
inline |
Accessor for the height at the base point.
Definition at line 53 of file BasePoint.h.
|
inline |
Accessor for the height at the base point.
Definition at line 51 of file BasePoint.h.
bool Mercator::BasePoint::operator!= | ( | const BasePoint & | rhs | ) | const |
Definition at line 24 of file BasePoint.cpp.
bool Mercator::BasePoint::operator== | ( | const BasePoint & | rhs | ) | const |
Definition at line 19 of file BasePoint.cpp.
|
inline |
Accessor for the roughness at the base point.
Definition at line 58 of file BasePoint.h.
|
inline |
Accessor for the roughness at the base point.
Definition at line 56 of file BasePoint.h.
Referenced by Mercator::HeightMap::fill2d().
unsigned int Mercator::BasePoint::seed | ( | ) | const |
Calculate the random seed used at this base point.
Definition at line 14 of file BasePoint.cpp.
Referenced by Mercator::HeightMap::fill2d().
|
staticconstexpr |
Default falloff at the base point.
Definition at line 34 of file BasePoint.h.
|
staticconstexpr |
Default height at the base point.
Definition at line 30 of file BasePoint.h.
|
staticconstexpr |
Default roughness at the base point.
Definition at line 32 of file BasePoint.h.