mercator
0.4.0
A terrain generation library for the Worldforge system.
|
5 #ifndef MERCATOR_HEIGHTMAP_H
6 #define MERCATOR_HEIGHTMAP_H
11 #include <wfmath/vector.h>
40 float get(
int x,
int z)
const {
41 return m_data[z * (m_res + 1) + x];
45 WFMath::Vector<3> &normal)
const;
46 void getHeight(
float x,
float z,
float &h)
const;
49 float getMax()
const {
return m_max; }
51 float getMin()
const {
return m_min; }
62 float qRMD(WFMath::MTRand& rng,
float nn,
float fn,
float ff,
float nf,
63 float roughness,
float falloff,
float depth)
const;
70 #endif // MERCATOR_HEIGHTMAP_H
float getMin() const
Accessor for the minimum height value in this Segment.
std::vector< float > m_data
Pointer to buffer containing data values.
int getResolution() const
Accessor for resolution of this segment.
float get(int x, int z) const
Get the height at a relative integer position in the Segment.
void getHeightAndNormal(float x, float z, float &h, WFMath::Vector< 3 > &normal) const
Get an accurate height and normal vector at a given coordinate relative to this segment.
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Point on the fundamental grid that is used as the basis for terrain.
Template for managing buffers of data for a segment.
void fill2d(const BasePoint &p1, const BasePoint &p2, const BasePoint &p3, const BasePoint &p4)
Two dimensional midpoint displacement fractal.
HeightMap(int resolution)
Construct an empty height map with the given resolution.
float getMax() const
Accessor for the maximum height value in this Segment.
void checkMaxMin(float h)
Check a value against m_min and m_max and set one of them if appropriate.