5 #ifndef MERCATOR_TERRAIN_MOD_IMPL_H 6 #define MERCATOR_TERRAIN_MOD_IMPL_H 8 #include <Mercator/TerrainMod.h> 10 #include <Mercator/Segment.h> 14 template <
template <
int>
class Shape>
25 template <
template <
int>
class Shape>
32 template <
template <
int>
class Shape>
43 template <
template <
int>
class Shape>
46 if (Contains(this->
m_shape,WFMath::Point<2>(x,y),
true)) {
51 template <
template <
int>
class Shape>
62 template <
template <
int>
class Shape>
65 if (Contains(this->
m_shape,WFMath::Point<2>(x,y),
true)) {
70 template <
template <
int>
class Shape>
81 template <
template <
int>
class Shape>
84 if (Contains(this->
m_shape,WFMath::Point<2>(x,y),
true)) {
85 float level = m_level + (this->
m_shape.getCenter()[0] - x) * m_dx
86 + (this->
m_shape.getCenter()[1] - y) * m_dy;
91 template <
template <
int>
class Shape>
105 template <
template <
int>
class Shape>
108 if (Contains(this->
m_shape,WFMath::Point<2>(x,y),
true)) {
113 template <
template <
int>
class Shape>
123 #endif // MERCATOR_TERRAIN_MOD_IMPL_H Terrain modifier that defines an area of sloped height.
Definition: TerrainMod.h:137
WFMath::AxisBox< 2 > getRect() const
The 2d area covered by this segment.
Definition: Segment.cpp:752
virtual void apply(float &point, int x, int y) const
Apply this modifier on a terrain segment.
Definition: TerrainMod_impl.h:63
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
ShapeTerrainMod(const Shape< 2 > &s)
Constructor.
Definition: TerrainMod_impl.h:15
Terrain modifier that defines a crater.
Definition: TerrainMod.h:173
virtual void apply(float &point, int x, int y) const
Apply this modifier on a terrain segment.
Definition: TerrainMod_impl.h:106
WFMath::AxisBox< 2 > m_box
The bounding box of the geometric shape.
Definition: Effector.h:70
virtual void apply(float &point, int x, int y) const
Apply this modifier on a terrain segment.
Definition: TerrainMod_impl.h:44
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
virtual void apply(float &point, int x, int y) const
Apply this modifier on a terrain segment.
Definition: TerrainMod_impl.h:82
Terrain modifier which is defined by a shape variable.
Definition: TerrainMod.h:56