vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
APNature::RandomFaultsAlgorithm Class Reference

#include <RandomFaultsAlgorithm.h>

Inheritance diagram for APNature::RandomFaultsAlgorithm:
APNature::TerrainAlgorithm

Public Member Functions

 RandomFaultsAlgorithm (int width, int height)
 
float * GenerateSurfaceByRandomFaults (int iterations, float faultValueMin, float faultValueMax)
 
- Public Member Functions inherited from APNature::TerrainAlgorithm
 TerrainAlgorithm (int width, int height)
 
 ~TerrainAlgorithm ()
 
unsigned int PointIndex (int x, int y) const
 
float GetLowestValue () const
 
float GetHighestValue () const
 

Additional Inherited Members

- Protected Member Functions inherited from APNature::TerrainAlgorithm
float * Allocate (int width, int height)
 
void Release ()
 
void Zero ()
 
void Flatten (float height)
 
float GetPointHeight (int x, int y) const
 
void SetPointHeight (int x, int y, float height)
 
- Protected Attributes inherited from APNature::TerrainAlgorithm
float * _terrain
 
int _width
 
int _height
 

Constructor & Destructor Documentation

RandomFaultsAlgorithm::RandomFaultsAlgorithm ( int  width,
int  height 
)

Initializes the attributes and allocates the memory for the terrain data.

Parameters
[in]widthSize of the terrain surface to generate in X-axis.
[in]heightSize of the terrain surface to generate in Y-axis.

Member Function Documentation

float * RandomFaultsAlgorithm::GenerateSurfaceByRandomFaults ( int  iterations,
float  faultValueMin,
float  faultValueMax 
)

Generates the terrain data according to the random faults generation algorithm.

[Based] on the random faults algorithm, described e.g. in Modern Computer Graphics, p.281

Parameters
[in]iterationsNumber of iterations.
[in]faultValueMinLower boundary of the interval in which the fault value is generated.
[in]faultValueMaxUpper boundary of the interval in which the fault value is generated.
Returns
Terrain surface data stored in one-dimensional array.

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