Mercator  0.4.0
Public Member Functions | Protected Attributes | List of all members
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 Mercator::Effector

Public Member Functions

 SlopeTerrainMod (float level, float dx, float dz, const Shape< 2 > &s)
 Constructor. More...
 
 SlopeTerrainMod (SlopeTerrainMod &)=delete
 Copy constructor.
 
virtual void apply (float &point, int x, int z) const
 Apply this modifier on a terrain segment. More...
 
void setShape (float level, float dx, float dz, const Shape< 2 > &s)
 
- Public Member Functions inherited from Mercator::ShapeTerrainMod< Shape >
 ShapeTerrainMod (const Shape< 2 > &s)
 Constructor. More...
 
bool checkIntersects (const Segment &s) const override
 
void setShape (const Shape< 2 > &s)
 
- Public Member Functions inherited from Mercator::TerrainMod
void setFunction (effector_func f)
 Change the function used to apply this mod to existing points.
 
- Public Member Functions inherited from Mercator::Effector
Contextcontext () const
 
void setContext (Context *)
 
const WFMath::AxisBox< 2 > & bbox () const
 Accessor for the bounding box of the geometric shape.
 

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_dz
 The rate of change of the height along Z.
 
- Protected Attributes inherited from Mercator::ShapeTerrainMod< Shape >
Shape< 2 > m_shape
 Shape of the modifier.
 
- Protected Attributes inherited from Mercator::TerrainMod
effector_func m_function
 Function used to apply this mod to existing points. More...
 
- Protected Attributes inherited from Mercator::Effector
WFMath::AxisBox< 2 > m_box
 The bounding box of the geometric shape.
 
Contextm_context
 The application context of this effector.
 

Additional Inherited Members

- Protected Member Functions inherited from Mercator::Effector
 Effector ()
 Constructor.
 
 Effector (const Effector &)
 Copy constructor.
 
Effectoroperator= (const Effector &)
 Assignment.
 

Detailed Description

template<template< int > class 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<template< int > class Shape>
Mercator::SlopeTerrainMod< Shape >::SlopeTerrainMod ( float  level,
float  dx,
float  dz,
const Shape< 2 > &  s 
)
inline

Constructor.

Parameters
levelthe height of the centre point.
dxthe rate of change of the height along X.
dzthe rate of change of the height along Z.
sshape of the modifier.

Member Function Documentation

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


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