2013-01-22 20:50:37 +00:00
|
|
|
#ifndef _PAYSAGES_CLOUDS_PUBLIC_H_
|
|
|
|
#define _PAYSAGES_CLOUDS_PUBLIC_H_
|
|
|
|
|
|
|
|
#include "../shared/types.h"
|
|
|
|
#include "../tools/lighting.h"
|
|
|
|
#include "../tools/curve.h"
|
|
|
|
#include "../tools/euclid.h"
|
|
|
|
#include "../noise.h"
|
|
|
|
#include "../layers.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CLOUDS_TYPE_CIRRUS,
|
|
|
|
CLOUDS_TYPE_CUMULUS,
|
|
|
|
CLOUDS_TYPE_STRATOCUMULUS,
|
|
|
|
CLOUDS_TYPE_STRATUS
|
|
|
|
} CloudsType;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2013-01-30 14:30:06 +00:00
|
|
|
CLOUDS_PRESET_PARTLY_CLOUDY,
|
2013-01-22 20:50:37 +00:00
|
|
|
} CloudsPreset;
|
|
|
|
|
2013-01-30 14:30:06 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CLOUDS_LAYER_PRESET_CIRRUS,
|
|
|
|
CLOUDS_LAYER_PRESET_CUMULUS,
|
|
|
|
CLOUDS_LAYER_PRESET_STRATOCUMULUS,
|
|
|
|
CLOUDS_LAYER_PRESET_STRATUS
|
|
|
|
} CloudsLayerPreset;
|
|
|
|
|
2013-01-22 20:50:37 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
CloudsType type;
|
|
|
|
double lower_altitude;
|
|
|
|
double thickness;
|
|
|
|
double base_coverage;
|
|
|
|
double shape_scaling;
|
|
|
|
double edge_scaling;
|
|
|
|
double edge_length;
|
|
|
|
SurfaceMaterial material;
|
|
|
|
double hardness;
|
|
|
|
double transparencydepth;
|
|
|
|
double lighttraversal;
|
|
|
|
double minimumlight;
|
|
|
|
|
|
|
|
Curve* _coverage_by_altitude;
|
2013-01-27 19:57:43 +00:00
|
|
|
NoiseGenerator* _coverage_noise;
|
2013-01-22 20:50:37 +00:00
|
|
|
NoiseGenerator* _shape_noise;
|
|
|
|
NoiseGenerator* _edge_noise;
|
|
|
|
} CloudsLayerDefinition;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Layers* layers;
|
|
|
|
} CloudsDefinition;
|
|
|
|
|
2013-01-27 19:57:43 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int inside;
|
|
|
|
double density;
|
|
|
|
double distance_to_edge;
|
|
|
|
} CloudsInfo;
|
2013-01-22 20:50:37 +00:00
|
|
|
|
|
|
|
typedef Color (*FuncCloudsGetColor)(Renderer* renderer, Color base, Vector3 start, Vector3 end);
|
2013-01-27 19:57:43 +00:00
|
|
|
typedef CloudsInfo (*FuncCloudsGetLayerInfo)(Renderer* renderer, CloudsLayerDefinition* layer, Vector3 location);
|
2013-01-22 20:50:37 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
CloudsDefinition* definition;
|
|
|
|
|
|
|
|
FuncCloudsGetColor getColor;
|
|
|
|
FuncLightingAlterLight alterLight;
|
2013-01-27 19:57:43 +00:00
|
|
|
FuncCloudsGetLayerInfo getLayerInfo;
|
2013-01-22 20:50:37 +00:00
|
|
|
} CloudsRenderer;
|
|
|
|
|
|
|
|
|
|
|
|
extern StandardDefinition CloudsDefinitionClass;
|
|
|
|
extern StandardRenderer CloudsRendererClass;
|
|
|
|
|
|
|
|
|
|
|
|
LayerType cloudsGetLayerType();
|
2013-01-30 14:30:06 +00:00
|
|
|
void cloudsAutoPreset(CloudsDefinition* definition, CloudsPreset preset);
|
|
|
|
void cloudsLayerAutoPreset(CloudsLayerDefinition* definition, CloudsLayerPreset preset);
|
2013-01-22 20:50:37 +00:00
|
|
|
|
|
|
|
Renderer* cloudsCreatePreviewCoverageRenderer();
|
2013-01-30 10:57:41 +00:00
|
|
|
Color cloudsGetPreviewCoverage(Renderer* renderer, double x, double y, double scaling, int perspective);
|
2013-01-22 20:50:37 +00:00
|
|
|
|
|
|
|
Renderer* cloudsCreatePreviewColorRenderer();
|
|
|
|
Color cloudsGetPreviewColor(Renderer* renderer, double x, double y);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|