mercator
0.4.0
A terrain generation library for the Worldforge system.
|
Terrain modifier that defines an area of adjusted height. More...
#include <TerrainMod.h>
Public Member Functions | |
AdjustTerrainMod (float dist, const Shape< 2 > &s) | |
Constructor. More... | |
AdjustTerrainMod (AdjustTerrainMod &)=delete | |
Copy constructor. More... | |
virtual void | apply (float &point, int x, int z) const |
Apply this modifier on a terrain segment. More... | |
void | setShape (float dist, const Shape< 2 > &s) |
bool | checkIntersects (const Segment &s) const override |
void | setShape (const Shape< 2 > &s) |
void | setFunction (effector_func f) |
Change the function used to apply this mod to existing points. More... | |
Context * | context () const |
void | setContext (std::unique_ptr< Context > context) |
const WFMath::AxisBox< 2 > & | bbox () const |
Accessor for the bounding box of the geometric shape. More... | |
Protected Attributes | |
float | m_dist |
Adjustment to the height of all points affected. More... | |
Shape< 2 > | m_shape |
Shape of the modifier. More... | |
effector_func | m_function |
Function used to apply this mod to existing points. More... | |
WFMath::AxisBox< 2 > | m_box |
The bounding box of the geometric shape. More... | |
std::unique_ptr< Context > | m_context |
The application context of this effector. More... | |
Terrain modifier that defines an area of adjusted height.
This modifier changes the altitude of all points inside the shape by the same amount.
Definition at line 104 of file TerrainMod.h.
|
inline |
Constructor.
dist | adjustment to the height of all points affected. |
s | shape of the modifier. |
Definition at line 112 of file TerrainMod.h.
References Mercator::TerrainMod::apply().
|
delete |
Copy constructor.
|
virtual |
Apply this modifier on a terrain segment.
The segment is at x,y in local coordinates. Output is placed into point.
Implements Mercator::TerrainMod.
Definition at line 57 of file TerrainMod_impl.h.
References Mercator::ShapeTerrainMod< Shape >::m_shape.
|
inlineinherited |
Accessor for the bounding box of the geometric shape.
Definition at line 37 of file Effector.h.
References Mercator::Effector::Effector(), Mercator::Effector::m_box, and Mercator::Effector::operator=().
Referenced by Mercator::Segment::clearMods(), and Mercator::Forest::populate().
|
inlineinherited |
Change the function used to apply this mod to existing points.
Definition at line 36 of file TerrainMod.h.
References Mercator::TerrainMod::apply().
|
protectedinherited |
The bounding box of the geometric shape.
Definition at line 57 of file Effector.h.
Referenced by Mercator::Effector::bbox(), Mercator::Area::contains(), Mercator::Effector::operator=(), Mercator::Area::setShape(), and Mercator::ShapeTerrainMod< Shape >::ShapeTerrainMod().
|
protectedinherited |
The application context of this effector.
Definition at line 60 of file Effector.h.
Referenced by Mercator::Effector::operator=().
|
protected |
Adjustment to the height of all points affected.
Definition at line 126 of file TerrainMod.h.
|
protectedinherited |
Function used to apply this mod to existing points.
This makes the basic mods much more powerful without the need for extra classes. It completely obsoletes AdjustTerrainMod, which is now the same as LevelTerrainMod with this function changed from set() to sum()
Definition at line 29 of file TerrainMod.h.
Referenced by Mercator::LevelTerrainMod< Shape >::apply(), and Mercator::SlopeTerrainMod< Shape >::apply().
|
protectedinherited |
Shape of the modifier.
Definition at line 67 of file TerrainMod.h.
Referenced by Mercator::LevelTerrainMod< Shape >::apply(), Mercator::AdjustTerrainMod< Shape >::apply(), Mercator::SlopeTerrainMod< Shape >::apply(), Mercator::CraterTerrainMod< Shape >::apply(), and Mercator::ShapeTerrainMod< Shape >::ShapeTerrainMod().