VoxelFarm::CHydroTile Class Reference

It generates the water information for an area. More...

#include <HydroTile.h>

Public Member Functions

 CHydroTile (int size, int pageSize, IHydroHeightmapPage *heightmap, double xo, double zo, double xsize, double zsize, double seaLevel, double springLevel)
 
void generate (CellId masterCell)
 Generates the water information for the tile.
 
double getHeight (int x, int z)
 
bool isOcean (int x, int z)
 Returns if a cell in the tile is in the ocean.
 
double getWaterHeight (double x, double z, int pageXc, int pageZc, double pageSize)
 Returns the water level in any point inside the tile.
 
double getRiverDensity (double x, double z, int pageXc, int pageZc, double pageSize)
 
bool & getPage (int x, int z)
 Calculates the page index for a given cell coordinates.
 

Static Public Member Functions

static double biLinearInterpolate (double p[2][2], double x, double y)
 

Public Attributes

int size
 
IHydroHeightmapPageheightmap
 
double xo
 
double zo
 
double xsize
 
double zsize
 
double seaLevel
 
double springLevel
 
unsigned char * data
 
double * waterHeight
 
bool * riverMap
 
bool * lakeMap
 
double * heights
 
bool * oceanMap
 
bool * pageIndex
 
int pageSize
 
int pageIndexSize
 
int pageScale
 

Detailed Description

It generates the water information for an area.

Definition at line 20 of file HydroTile.h.

Constructor & Destructor Documentation

VoxelFarm::CHydroTile::CHydroTile ( int  size,
int  pageSize,
IHydroHeightmapPage heightmap,
double  xo,
double  zo,
double  xsize,
double  zsize,
double  seaLevel,
double  springLevel 
)
Parameters
sizeNumber of cells the area is divided
pageSizeThe terrain is divided into pages
heightmapMap of heigths for the terrain
xoOrigin of the area
xsizeSizes of the area
seaLevelOcean level. The points of water are traced down to that level.
springLevelSpring level. The points of water are located over that level.

Member Function Documentation

double VoxelFarm::CHydroTile::getHeight ( int  x,
int  z 
)
inline

Returns the heigth for the terrain in a given cell. Calculates the page index for the cell and load it from the heightmap if not is already loaded.

Definition at line 61 of file HydroTile.h.


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