2012-12-02 11:08:56 +00:00
|
|
|
#ifndef _PAYSAGES_ATMOSPHERE_PUBLIC_H_
|
|
|
|
#define _PAYSAGES_ATMOSPHERE_PUBLIC_H_
|
2012-11-25 21:53:01 +00:00
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "../tools/lighting.h"
|
|
|
|
#include "../tools/euclid.h"
|
|
|
|
#include "../tools/color.h"
|
|
|
|
#include "../tools/pack.h"
|
2012-11-25 21:53:01 +00:00
|
|
|
#include "../layers.h"
|
2013-01-19 22:42:50 +00:00
|
|
|
#include "../shared/types.h"
|
2012-11-25 21:53:01 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-12-24 13:59:17 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ATMOSPHERE_PRESET_CLEAR_DAY = 0,
|
|
|
|
ATMOSPHERE_PRESET_CLEAR_SUNSET = 1,
|
|
|
|
ATMOSPHERE_PRESET_HAZY_MORNING = 2,
|
|
|
|
ATMOSPHERE_PRESET_FOGGY = 3,
|
|
|
|
ATMOSPHERE_PRESET_STORMY = 4
|
|
|
|
} AtmospherePreset;
|
|
|
|
|
2012-11-25 21:53:01 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ATMOSPHERE_MODEL_PREETHAM = 0,
|
|
|
|
ATMOSPHERE_MODEL_BRUNETON = 1
|
|
|
|
} AtmosphereModel;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
AtmosphereModel model;
|
2012-12-24 15:15:40 +00:00
|
|
|
int hour;
|
|
|
|
int minute;
|
2012-11-25 21:53:01 +00:00
|
|
|
double humidity;
|
|
|
|
Color sun_color;
|
|
|
|
double sun_radius;
|
|
|
|
double dome_lighting;
|
2012-12-24 15:15:40 +00:00
|
|
|
|
|
|
|
double _daytime;
|
2012-11-25 21:53:01 +00:00
|
|
|
} AtmosphereDefinition;
|
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
typedef void (*FuncAtmosphereGetLightingStatus)(Renderer* renderer, LightStatus* status, Vector3 normal, int opaque);
|
2012-11-25 21:53:01 +00:00
|
|
|
typedef Color (*FuncAtmosphereApplyAerialPerspective)(Renderer* renderer, Vector3 location, Color base);
|
|
|
|
typedef Color (*FuncAtmosphereGetSkyColor)(Renderer* renderer, Vector3 direction);
|
|
|
|
typedef Vector3 (*FuncAtmosphereGetSunDirection)(Renderer* renderer);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
AtmosphereDefinition* definition;
|
2012-12-02 11:08:56 +00:00
|
|
|
|
2013-01-19 22:42:50 +00:00
|
|
|
FuncAtmosphereGetLightingStatus getLightingStatus;
|
2012-11-25 21:53:01 +00:00
|
|
|
FuncAtmosphereApplyAerialPerspective applyAerialPerspective;
|
|
|
|
FuncAtmosphereGetSkyColor getSkyColor;
|
|
|
|
FuncAtmosphereGetSunDirection getSunDirection;
|
2012-12-02 11:08:56 +00:00
|
|
|
|
2013-01-20 21:17:03 +00:00
|
|
|
/*void* _internal_data;*/
|
2012-11-25 21:53:01 +00:00
|
|
|
} AtmosphereRenderer;
|
|
|
|
|
|
|
|
extern StandardDefinition AtmosphereDefinitionClass;
|
|
|
|
extern StandardRenderer AtmosphereRendererClass;
|
|
|
|
|
2012-12-24 13:59:17 +00:00
|
|
|
void atmosphereAutoPreset(AtmosphereDefinition* definition, AtmospherePreset preset);
|
2012-11-25 21:53:01 +00:00
|
|
|
void atmosphereRenderSkydome(Renderer* renderer);
|
2013-01-20 15:07:45 +00:00
|
|
|
Renderer* atmosphereCreatePreviewRenderer();
|
2012-12-07 14:15:28 +00:00
|
|
|
Color atmosphereGetPreview(Renderer* renderer, double x, double y, double heading);
|
2012-11-25 21:53:01 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|