5 #ifndef MERCATOR_TERRAIN_MOD_H 6 #define MERCATOR_TERRAIN_MOD_H 8 #include <Mercator/Effector.h> 10 #include <wfmath/intersect.h> 11 #include <wfmath/ball.h> 35 int addToSegment(
Segment &)
const;
36 void updateToSegment(
Segment &)
const;
37 void removeFromSegment(
Segment &)
const;
48 virtual void apply(
float &point,
int x,
int y)
const = 0;
55 template <
template <
int>
class Shape>
65 virtual bool checkIntersects(
const Segment& s)
const;
67 void setShape(
const Shape<2> & s);
77 template <
template <
int>
class Shape>
90 virtual void apply(
float &point,
int x,
int y)
const;
92 void setShape(
float level,
const Shape<2> & s);
106 template <
template <
int>
class Shape>
120 virtual void apply(
float &point,
int x,
int y)
const;
122 void setShape(
float dist,
const Shape<2> & s);
136 template <
template <
int>
class Shape>
152 virtual void apply(
float &point,
int x,
int y)
const;
154 void setShape(
float level,
float dx,
float dy,
const Shape<2> & s);
172 template <
template <
int>
class Shape>
184 virtual void apply(
float &point,
int x,
int y)
const;
186 void setShape(
float level,
const Shape<2> & s);
198 #endif // MERCATOR_TERRAIN_MOD_H CraterTerrainMod(float level, const Shape< 2 > &s)
Constructor.
Definition: TerrainMod.h:179
Device which effects a change in the terrain.
Definition: Effector.h:25
float m_dx
The rate of change of the height along X.
Definition: TerrainMod.h:163
void setFunction(effector_func f)
Change the function used to apply this mod to existing points.
Definition: TerrainMod.h:40
float m_level
The height level of all points affected.
Definition: TerrainMod.h:99
Terrain modifier that defines an area of sloped height.
Definition: TerrainMod.h:137
SlopeTerrainMod(float level, float dx, float dy, const Shape< 2 > &s)
Constructor.
Definition: TerrainMod.h:147
effector_func m_function
Function used to apply this mod to existing points.
Definition: TerrainMod.h:29
Class storing heightfield and other data for a single fixed size square area of terrain defined by fo...
Definition: Segment.h:36
Shape< 2 > m_shape
Shape of the modifier.
Definition: TerrainMod.h:70
virtual void apply(float &point, int x, int y) const =0
Apply this modifier on a terrain segment.
Terrain modifier that defines a crater.
Definition: TerrainMod.h:173
float m_level
The height level of the crater center.
Definition: TerrainMod.h:193
float m_dist
Adjustment to the height of all points affected.
Definition: TerrainMod.h:129
Terrain modifier that defines an area of adjusted height.
Definition: TerrainMod.h:107
Terrain modifier that defines an area of fixed height.
Definition: TerrainMod.h:78
LevelTerrainMod(float level, const Shape< 2 > &s)
Constructor.
Definition: TerrainMod.h:85
float m_level
The height of the centre point.
Definition: TerrainMod.h:161
float m_dy
The rate of change of the height along Y.
Definition: TerrainMod.h:165
AdjustTerrainMod(float dist, const Shape< 2 > &s)
Constructor.
Definition: TerrainMod.h:115
Base class for modifiers to the procedurally generated terrain.
Definition: TerrainMod.h:20
Terrain modifier which is defined by a shape variable.
Definition: TerrainMod.h:56