#include <mod_sim_terrain_heightmap.hh>
Public Types | |
| typedef uint8 | Height |
Public Member Functions | |
| Heightmap (void) | |
| Heightmap (const InitArgs &initArgs) | |
| Heightmap (const InitArgs &initArgs, const NoiseArgs &noiseArgs) | |
| ~Heightmap () | |
| void | SetHeight (const int hmLat, const int hmLon, const Height height) |
| fp | GetHeight (const int hmLat, const int hmLon) const |
| |
| Heightmap::Height | GetHeightDirect (const int hmLat, const int hmLon) const |
| fp | GetHeightScaled (const int hmLat, const int hmLon) const |
| |
| fp | GetHeightScaledInterpolated (const fp worldLat, const fp worldLon) const |
| |
| CLASS_METHOD Heightmap::Height | GetHeightMedian (void) |
| fp | ScaleHeight (const Height height) |
| WorldVertex | GetPosition (const int hmLat, const int hmLon) const |
| Converse of GetIdx(hmLat,hmLon). | |
| uint | GetIdx (const int hmLat, const int hmLon) const |
| |
| SharedPtr< Texture > | GetColormapTexture (void) const |
| TexCoord | GetColormapTexCoord (const fp worldLat, const fp worldLon) const |
| bool | IfInsideApprox (const fp worldLat, const fp worldLon) const |
| Elem & | operator[] (uint i) |
| const Elem & | operator[] (uint i) const |
Public Attributes | |
| CLASS_CONST uint | HEIGHT_INVALID = 0xff |
| CLASS_CONST uint | HEIGHT_LIMIT = 0xfe |
| CLASS_VAR bool | msDisableIfInsideApprox = false |
Private Types | |
| typedef Array2D < Elem, Shared > | HeightmapArray2D |
Private Member Functions | |
| void | Init (const InitArgs &initArgs) |
| void | InitRandomNumbers (const InitArgs &initArgs) |
| void | ComputePalette (void) |
Private Attributes | |
| CLASS_VAR int | msHeightmapWidthMinus1 |
| CLASS_VAR Array2D< fp > | msRandomHeight |
| random offset | |
| CLASS_VAR Array2D< uint > | msRandomColor |
| random offset | |
| CLASS_VAR vector< RGBA > | msPalette |
| for constructing colormap (water,land,snow) | |
| CLASS_VAR WaterTexture * | msWaterTexture = NULL |
| bool | mValid |
| BoxVolume | mBoxVolume |
| volume this Heightmap occupies in World Space | |
| fp | mWidthInWorld |
| width of this Heightmap in World coords | |
| fp | mHeightScale |
| scales height values | |
| fp | mHeightScaleHalf |
| fp | mWorldHeightmapRatio |
| maps world coords to heightmap coords | |
| fp | mHeightmapWorldRatio |
| inverse (reciprocal) | |
| HeightmapArray2D | mHeightmap |
| heightmap values in a 2D array | |
| int | mHeightmapWidth |
| width in height elements | |
| shptr< Texture > | mColormapTexture |
| separate from Engine's texture set | |
Friends | |
| class | Terrain |
| class | TileFactory |
| class | TextureTask |
Classes | |
| class | Elem |
| Element of a heightmap. More... | |
| struct | InitArgs |
| struct | NoiseArgs |
| class | TextureTask |
| class | WaterTexture |
Heightmap minimizes memory at expense of recomputing. Recomputing the same values is actually faster than storing them because the large size of the heightmap would flood the system's memory.
Heightmap relies on the ability of Array2D to clamp 2D coordinates. That is, if a (lat,lon) is slightly past the edge of the world, it will be clamped at the existing element at the edge.
Invalid heightmaps are cheap to construct and used as flags.
| typedef uint8 mod_sim::Heightmap::Height |
typedef Array2D<Elem,Shared> mod_sim::Heightmap::HeightmapArray2D [private] |
| mod_sim::Heightmap::Heightmap | ( | void | ) |
ctor/dtor. This is parameterized (independent of globals such as gWorld).
| mod_sim::Heightmap::Heightmap | ( | const InitArgs & | initArgs | ) |
Dynamically create a heightmap using Perlin noise.
| initArgs | ||
| noiseArgs |
| mod_sim::Heightmap::~Heightmap | ( | ) |
| void mod_sim::Heightmap::Init | ( | const InitArgs & | initArgs | ) | [private] |
| void mod_sim::Heightmap::InitRandomNumbers | ( | const InitArgs & | initArgs | ) | [private] |
Pre-compute random numbers to be reused at edges of heightmaps in order to make them seamless.
| void mod_sim::Heightmap::ComputePalette | ( | void | ) | [private] |
Compute palette. Used to be updated for every Heightmap but is pre-computed.
| void mod_sim::Heightmap::SetHeight | ( | const int | hmLat, | |
| const int | hmLon, | |||
| const Height | height | |||
| ) | [inline] |
| fp mod_sim::Heightmap::GetHeight | ( | const int | hmLat, | |
| const int | hmLon | |||
| ) | const [inline] |
| Heightmap::Height mod_sim::Heightmap::GetHeightDirect | ( | const int | hmLat, | |
| const int | hmLon | |||
| ) | const [inline] |
| fp mod_sim::Heightmap::GetHeightScaled | ( | const int | hmLat, | |
| const int | hmLon | |||
| ) | const [inline] |
| fp mod_sim::Heightmap::GetHeightScaledInterpolated | ( | const fp | worldLat, | |
| const fp | worldLon | |||
| ) | const [inline] |
| Heightmap::Height mod_sim::Heightmap::GetHeightMedian | ( | void | ) |
Get an average height value. THIS VALUE MAY CHANGE AS HEIGHTMAPS ARE MADE.
| WorldVertex mod_sim::Heightmap::GetPosition | ( | const int | hmLat, | |
| const int | hmLon | |||
| ) | const [inline] |
Converse of GetIdx(hmLat,hmLon).
| uint mod_sim::Heightmap::GetIdx | ( | const int | hmLat, | |
| const int | hmLon | |||
| ) | const [inline] |
| SharedPtr<Texture> mod_sim::Heightmap::GetColormapTexture | ( | void | ) | const [inline] |
| TexCoord mod_sim::Heightmap::GetColormapTexCoord | ( | const fp | worldLat, | |
| const fp | worldLon | |||
| ) | const [inline] |
friend class Terrain [friend] |
friend class TileFactory [friend] |
friend class TextureTask [friend] |
| CLASS_CONST uint mod_sim::Heightmap::HEIGHT_INVALID = 0xff |
| CLASS_CONST uint mod_sim::Heightmap::HEIGHT_LIMIT = 0xfe |
int mod_sim::Heightmap::msHeightmapWidthMinus1 [private] |
Array2D< fp > mod_sim::Heightmap::msRandomHeight [private] |
random offset
Array2D< uint > mod_sim::Heightmap::msRandomColor [private] |
random offset
vector< RGBA > mod_sim::Heightmap::msPalette [private] |
for constructing colormap (water,land,snow)
Heightmap::WaterTexture * mod_sim::Heightmap::msWaterTexture = NULL [private] |
bool mod_sim::Heightmap::mValid [private] |
BoxVolume mod_sim::Heightmap::mBoxVolume [private] |
volume this Heightmap occupies in World Space
fp mod_sim::Heightmap::mWidthInWorld [private] |
width of this Heightmap in World coords
fp mod_sim::Heightmap::mHeightScale [private] |
scales height values
fp mod_sim::Heightmap::mHeightScaleHalf [private] |
fp mod_sim::Heightmap::mWorldHeightmapRatio [private] |
maps world coords to heightmap coords
fp mod_sim::Heightmap::mHeightmapWorldRatio [private] |
inverse (reciprocal)
heightmap values in a 2D array
int mod_sim::Heightmap::mHeightmapWidth [private] |
width in height elements
shptr<Texture> mod_sim::Heightmap::mColormapTexture [private] |
separate from Engine's texture set
| bool mod_sim::Heightmap::msDisableIfInsideApprox = false |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:31 2007