2012-07-13 12:23:58 +00:00
|
|
|
#ifndef _PAYSAGES_HEIGHTMAP_H_
|
|
|
|
#define _PAYSAGES_HEIGHTMAP_H_
|
|
|
|
|
|
|
|
/* Height map for terrain */
|
|
|
|
|
|
|
|
#include "pack.h"
|
2012-07-24 14:59:06 +00:00
|
|
|
#include "noise.h"
|
2012-08-08 13:30:40 +00:00
|
|
|
#include "geoarea.h"
|
|
|
|
#include "terrain.h"
|
2012-07-13 12:23:58 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int resolution_x;
|
|
|
|
int resolution_z;
|
|
|
|
double* data;
|
|
|
|
} HeightMap;
|
|
|
|
|
2012-07-16 15:48:05 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double relative_x;
|
|
|
|
double relative_z;
|
|
|
|
double hard_radius;
|
|
|
|
double smoothed_size;
|
2012-07-26 11:55:19 +00:00
|
|
|
double total_radius;
|
2012-07-16 15:48:05 +00:00
|
|
|
} HeightMapBrush;
|
|
|
|
|
2012-07-13 12:23:58 +00:00
|
|
|
HeightMap heightmapCreate();
|
|
|
|
void heightmapDelete(HeightMap* heightmap);
|
|
|
|
void heightmapCopy(HeightMap* source, HeightMap* destination);
|
|
|
|
void heightmapValidate(HeightMap* heightmap);
|
|
|
|
|
|
|
|
void heightmapSave(PackStream* stream, HeightMap* heightmap);
|
|
|
|
void heightmapLoad(PackStream* stream, HeightMap* heightmap);
|
2012-07-13 21:24:19 +00:00
|
|
|
|
2012-07-23 21:14:26 +00:00
|
|
|
void heightmapGetLimits(HeightMap* heightmap, double* ymin, double* ymax);
|
2012-07-23 09:58:06 +00:00
|
|
|
double heightmapGetRawValue(HeightMap* heightmap, double x, double z);
|
|
|
|
double heightmapGetValue(HeightMap* heightmap, double x, double z);
|
2012-07-19 15:04:27 +00:00
|
|
|
|
2012-07-13 21:24:19 +00:00
|
|
|
void heightmapChangeResolution(HeightMap* heightmap, int resolution_x, int resolution_z);
|
2012-07-23 09:58:06 +00:00
|
|
|
void heightmapImportFromPicture(HeightMap* heightmap, const char* picturepath);
|
2012-08-08 13:30:40 +00:00
|
|
|
void heightmapRevertToTerrain(HeightMap* heightmap, TerrainDefinition* terrain, GeoArea* area);
|
2012-07-16 15:48:05 +00:00
|
|
|
|
|
|
|
void heightmapBrushElevation(HeightMap* heightmap, HeightMapBrush* brush, double value);
|
2012-07-24 14:59:06 +00:00
|
|
|
void heightmapBrushSmooth(HeightMap* heightmap, HeightMapBrush* brush, double value);
|
|
|
|
void heightmapBrushAddNoise(HeightMap* heightmap, HeightMapBrush* brush, NoiseGenerator* generator, double value);
|
2012-07-13 12:23:58 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|