5 #ifndef MERCATOR_TERRAIN_MOD_H 6 #define MERCATOR_TERRAIN_MOD_H 10 #include <wfmath/intersect.h> 11 #include <wfmath/ball.h> 44 virtual void apply(
float &point,
int x,
int z)
const = 0;
51 template <
template <
int>
class Shape>
62 bool checkIntersects(
const Segment& s)
const override;
64 void setShape(
const Shape<2> & s);
74 template <
template <
int>
class Shape>
90 virtual void apply(
float &point,
int x,
int z)
const;
92 void setShape(
float level,
const Shape<2> & s);
103 template <
template <
int>
class Shape>
120 virtual void apply(
float &point,
int x,
int z)
const;
122 void setShape(
float dist,
const Shape<2> & s);
133 template <
template <
int>
class Shape>
152 virtual void apply(
float &point,
int x,
int z)
const;
154 void setShape(
float level,
float dx,
float dz,
const Shape<2> & s);
169 template <
template <
int>
class Shape>
184 virtual void apply(
float &point,
int x,
int z)
const;
186 void setShape(
float level,
const Shape<2> & s);
195 #endif // MERCATOR_TERRAIN_MOD_H CraterTerrainMod(float level, const Shape< 2 > &s)
Constructor.
Device which effects a change in the terrain.
float m_dx
The rate of change of the height along X.
void setFunction(effector_func f)
Change the function used to apply this mod to existing points.
float m_level
The height level of all points affected.
Terrain modifier that defines an area of sloped height.
effector_func m_function
Function used to apply this mod to existing points.
SlopeTerrainMod(float level, float dx, float dz, const Shape< 2 > &s)
Constructor.
virtual void apply(float &point, int x, int z) const =0
Apply this modifier on a terrain segment.
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
float m_dz
The rate of change of the height along Z.
Shape< 2 > m_shape
Shape of the modifier.
Terrain modifier that defines a crater.
float m_level
The height level of the crater center.
float m_dist
Adjustment to the height of all points affected.
Terrain modifier that defines an area of adjusted height.
Terrain modifier that defines an area of fixed height.
LevelTerrainMod(float level, const Shape< 2 > &s)
Constructor.
float m_level
The height of the centre point.
AdjustTerrainMod(float dist, const Shape< 2 > &s)
Constructor.
Base class for modifiers to the procedurally generated terrain.
Terrain modifier which is defined by a shape variable.