Mercator::SlopeTerrainMod< Shape > Class Template Reference

Terrain modifier that defines an area of sloped height. More...

#include <TerrainMod.h>

Inheritance diagram for Mercator::SlopeTerrainMod< Shape >:

Mercator::ShapeTerrainMod< Shape > Mercator::TerrainMod

List of all members.

Public Member Functions

 SlopeTerrainMod (float level, float dx, float dy, const Shape &s)
 Constructor.
virtual void apply (float &point, int x, int y) const
 Apply this modifier on a terrain segment.
virtual TerrainModclone () const
 Create a copy of this modifier.

Protected Attributes

float m_level
 The height of the centre point.
float m_dx
 The rate of change of the height along X.
float m_dy
 The rate of change of the height along Y.

Private Member Functions

 SlopeTerrainMod (SlopeTerrainMod &)
 Copy constructor.


Detailed Description

template<typename Shape>
class Mercator::SlopeTerrainMod< Shape >

Terrain modifier that defines an area of sloped height.

This modifier creates a sloped area. The center point is set to a level and all other points are set based on specified gradients.


Constructor & Destructor Documentation

template<typename Shape>
Mercator::SlopeTerrainMod< Shape >::SlopeTerrainMod ( float  level,
float  dx,
float  dy,
const Shape &  s 
) [inline]

Constructor.

Parameters:
level the height of the centre point.
dx the rate of change of the height along X.
dy the rate of change of the height along Y.
s shape of the modifier.


Member Function Documentation

template<typename Shape>
void Mercator::SlopeTerrainMod< Shape >::apply ( float &  point,
int  x,
int  y 
) const [inline, 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.

References Mercator::SlopeTerrainMod< Shape >::m_dx, Mercator::SlopeTerrainMod< Shape >::m_dy, Mercator::SlopeTerrainMod< Shape >::m_level, and Mercator::ShapeTerrainMod< Shape >::m_shape.


The documentation for this class was generated from the following files:

Generated for Mercator by  doxygen 1.5.6