2012-07-10 14:28:47 +00:00
|
|
|
#ifndef _PAYSAGES_TERRAINCANVAS_H_
|
|
|
|
#define _PAYSAGES_TERRAINCANVAS_H_
|
|
|
|
|
|
|
|
/* Terrain edition by painting over an area */
|
|
|
|
|
|
|
|
#include "pack.h"
|
|
|
|
#include "noise.h"
|
|
|
|
#include "terrain.h"
|
|
|
|
#include "layers.h"
|
2012-07-13 12:23:58 +00:00
|
|
|
#include "heightmap.h"
|
2012-08-08 13:30:40 +00:00
|
|
|
#include "geoarea.h"
|
2012-07-10 14:28:47 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-07-18 15:04:23 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int mode;
|
|
|
|
double smoothing;
|
|
|
|
} IntegrationMask;
|
|
|
|
|
|
|
|
#define INTEGRATIONMASK_MODE_SQUARE 0
|
|
|
|
#define INTEGRATIONMASK_MODE_CIRCLE 1
|
2012-07-10 14:28:47 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GeoArea area;
|
2012-07-19 15:04:27 +00:00
|
|
|
double offset_y;
|
2012-07-10 14:28:47 +00:00
|
|
|
HeightMap height_map;
|
|
|
|
double height_factor;
|
|
|
|
NoiseGenerator* detail_noise;
|
|
|
|
double detail_height_factor;
|
|
|
|
double detail_scaling;
|
2012-07-18 15:04:23 +00:00
|
|
|
IntegrationMask mask;
|
2012-07-10 14:28:47 +00:00
|
|
|
} TerrainCanvas;
|
|
|
|
|
|
|
|
TerrainCanvas* terrainCanvasCreate();
|
|
|
|
void terrainCanvasDelete(TerrainCanvas* canvas);
|
|
|
|
void terrainCanvasCopy(TerrainCanvas* source, TerrainCanvas* destination);
|
|
|
|
void terrainCanvasValidate(TerrainCanvas* canvas);
|
|
|
|
LayerType terrainCanvasGetLayerType();
|
|
|
|
|
|
|
|
void terrainCanvasSave(PackStream* stream, TerrainCanvas* canvas);
|
|
|
|
void terrainCanvasLoad(PackStream* stream, TerrainCanvas* canvas);
|
|
|
|
|
2012-07-23 21:14:26 +00:00
|
|
|
void terrainCanvasGetLimits(TerrainCanvas* canvas, double* ymin, double* ymax);
|
2012-08-08 13:30:40 +00:00
|
|
|
void terrainCanvasRevertToTerrain(TerrainCanvas* canvas);
|
2012-07-16 20:34:01 +00:00
|
|
|
Vector3 terrainCanvasApply(TerrainCanvas* canvas, Vector3 location);
|
2012-08-08 15:32:54 +00:00
|
|
|
double terrainCanvasGetMaskValue(TerrainCanvas* canvas, double local_x, double local_z);
|
2012-07-10 14:28:47 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|