< index < 15. Heightmap toolkit < 15.3 Modifying the heightmap |
===================================== | > 15.5 Destroying a heightmap |
C++ : float TCODHeightmap::getValue(int x, int y) const C : float TCOD_heightmap_get_value(const TCOD_heightmap_t *hm, int x, int y) Py : heightmap_get_value(hm, x, y)
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
x,y | Coordinates of the map cell. 0 <= x < map width 0 <= y < map height |
C++ : float TCODHeightmap::getInterpolatedValue(float x, float y) const C : float TCOD_heightmap_get_interpolated_value(const TCOD_heightmap_t *hm, float x, float y) Py : heightmap_get_interpolated_value(hm, x, y)
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
x,y | Coordinates of the map cell. 0 <= x < map width 0 <= y < map height |
C++ : float TCODHeightmap::getSlope(int x, int y) const C : float TCOD_heightmap_get_slope(const TCOD_heightmap_t *hm, int x, int y) Py : heightmap_get_slope(hm, x, y)
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
x,y | Coordinates of the map cell. 0 <= x < map width 0 <= y < map height |
C++ : void TCODHeightmap::getNormal(float x, float y,float n[3], float waterLevel=0.0f) const C : void TCOD_heightmap_get_normal(const TCOD_heightmap_t *hm, float x, float y, float n[3], float waterLevel) Py : heightmap_get_normal(hm, x, y, waterLevel) # returns nx,ny,nz
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
x,y | Coordinates of the map cell. 0 <= x < map width 0 <= y < map height |
n | The function stores the normalized normal vector in this array. |
waterLevel | The map height is clamped at waterLevel so that the sea is flat. |
C++ : int TCODHeightmap::countCells(float min,float max) const C : int TCOD_heightmap_count_cells(const TCOD_heightmap_t *hm, float min, float max) Py : heightmap_count_cells(hm, min, max)
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
min,max | Only cells which value is >=min and <= max are counted. |
C++ : bool TCODHeightmap::hasLandOnBorder(float waterLevel) const C : bool TCOD_heightmap_has_land_on_border(const TCOD_heightmap_t *hm, float waterLevel) Py : heightmap_has_land_on_border(hm, waterLevel)
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
waterLevel | Return true only if no border cell is > waterLevel. |
C++ : void TCODHeightmap::getMinMax(float *min, float *max) const C : void TCOD_heightmap_get_minmax(const TCOD_heightmap_t *hm, float *min, float *max) Py : heightmap_get_minmax(hm) # returns min,max
Parameter | Description |
---|---|
hm | In the C version, the address of the heightmap struct returned by the creation function. |
min, max | The min and max values are returned in these variables. |