VoxelFarm::CHeightLayer Class Reference

One layer of an elevation map (heightmap). A VoxelFarm terrains starts with an elevation map. This map is a sum of the contributions of multiple height layers. Each biome can specify a different height layer. More...

#include <Biome.h>

Public Member Functions

 CHeightLayer (ITileSet *tileSet, int tilePeriod, double tileAmplitude, int noiseType, double noiseAmplitude, double noiseFreq, double noiseStep, double noiseLacunarity, int noiseOctaves)
 Constructs a HeightLayer object. More...
 
double getHeight (double x, double z)
 Returns the height for the provided point in the XZ plane as a double precision. This method will perform interpolation, providing smoother results.
 
double getHeight (double x, double z, double &noiseHeight, double &tileHeight, double &tileHeightMinFiltered, double &tileHeightMaxFiltered)
 Returns the height for the provided point in the XZ plane as a double precision. Also returns the noise and tile height components. This method will perform interpolation, providing smoother results.
 
unsigned int getHeight (int x, int z)
 Returns the height for the provided point in the XZ plane as an integer. This will not perfom any interpolation. Use this function if smoothness is not important.
 

Public Attributes

ITileSettileSet
 
int tilePeriod
 
double tileAmplitude
 
int noiseType
 
double noiseAmplitude
 
double noiseFreq
 
double noiseStep
 
double noiseLacunarity
 
int noiseOctaves
 

Detailed Description

One layer of an elevation map (heightmap). A VoxelFarm terrains starts with an elevation map. This map is a sum of the contributions of multiple height layers. Each biome can specify a different height layer.

Definition at line 24 of file Biome.h.

Constructor & Destructor Documentation

VoxelFarm::CHeightLayer::CHeightLayer ( ITileSet tileSet,
int  tilePeriod,
double  tileAmplitude,
int  noiseType,
double  noiseAmplitude,
double  noiseFreq,
double  noiseStep,
double  noiseLacunarity,
int  noiseOctaves 
)

Constructs a HeightLayer object.

Parameters
tileSetA TileSet object to be used for adding detail to the height layer
tilePeriodPeriod at which the tileset will be applied
tileAmplitudeMultiplier factor for the height component returned by the tileset
noiseTypeType of base noise. Only 0 (Perlin) is currently supported
noiseAmplitudeHeight for the base noise
noiseFreqFrequency of the base noise
noiseStepAmplitude increment for each octave of the base noise
noiseLacunarityFrequency increment for each octave of the base noise
noiseOctavesNumber of octaves in the base noise

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