Mercator
|
Base class for modifiers to the procedurally generated terrain. More...
#include <TerrainMod.h>
Public Member Functions | |
int | addToSegment (Segment &) const |
void | updateToSegment (Segment &) const |
void | removeFromSegment (Segment &) const |
void | setFunction (effector_func f) |
Change the function used to apply this mod to existing points. | |
virtual void | apply (float &point, int x, int y) const =0 |
Apply this modifier on a terrain segment. | |
Protected Attributes | |
effector_func | m_function |
Function used to apply this mod to existing points. |
Base class for modifiers to the procedurally generated terrain.
Anything that modifies the terrain implements this interface.
virtual void Mercator::TerrainMod::apply | ( | float & | point, |
int | x, | ||
int | y | ||
) | const [pure virtual] |
Apply this modifier on a terrain segment.
The segment is at x,y in local coordinates. Output is placed into point.
Implemented in Mercator::LevelTerrainMod< Shape >, Mercator::AdjustTerrainMod< Shape >, Mercator::SlopeTerrainMod< Shape >, and Mercator::CraterTerrainMod< Shape >.
Referenced by Mercator::Segment::applyMod().
effector_func Mercator::TerrainMod::m_function [protected] |
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()
Referenced by setFunction().