2011-12-10 13:25:22 +00:00
|
|
|
#ifndef _PAYSAGES_WATER_H_
|
|
|
|
#define _PAYSAGES_WATER_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
#include "renderer.h"
|
2012-01-22 18:39:42 +00:00
|
|
|
#include "lighting.h"
|
2012-01-23 23:45:33 +00:00
|
|
|
#include "noise.h"
|
2012-04-22 17:12:39 +00:00
|
|
|
#include "pack.h"
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-06-17 09:40:40 +00:00
|
|
|
double height;
|
|
|
|
double transparency;
|
|
|
|
double reflection;
|
2012-01-28 18:32:08 +00:00
|
|
|
SurfaceMaterial material;
|
2011-12-19 20:59:39 +00:00
|
|
|
Color depth_color;
|
2012-06-17 09:40:40 +00:00
|
|
|
double transparency_depth;
|
|
|
|
double lighting_depth;
|
2012-01-17 20:54:14 +00:00
|
|
|
NoiseGenerator* waves_noise;
|
2012-06-17 09:40:40 +00:00
|
|
|
double waves_noise_height;
|
|
|
|
double waves_noise_scale;
|
2011-12-10 13:25:22 +00:00
|
|
|
} WaterDefinition;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
|
|
|
Color base;
|
|
|
|
Color reflected;
|
|
|
|
Color refracted;
|
|
|
|
Color final;
|
|
|
|
} WaterResult;
|
|
|
|
|
2012-04-22 17:12:39 +00:00
|
|
|
void waterSave(PackStream* stream, WaterDefinition* definition);
|
|
|
|
void waterLoad(PackStream* stream, WaterDefinition* definition);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
|
|
|
WaterDefinition waterCreateDefinition();
|
2012-01-23 23:45:33 +00:00
|
|
|
void waterDeleteDefinition(WaterDefinition* definition);
|
|
|
|
void waterCopyDefinition(WaterDefinition* source, WaterDefinition* destination);
|
|
|
|
void waterValidateDefinition(WaterDefinition* definition);
|
|
|
|
|
2012-01-29 17:53:12 +00:00
|
|
|
HeightInfo waterGetHeightInfo(WaterDefinition* definition);
|
2012-01-23 23:45:33 +00:00
|
|
|
Color waterLightFilter(WaterDefinition* definition, Renderer* renderer, Color light, Vector3 location, Vector3 light_location, Vector3 direction_to_light);
|
|
|
|
WaterResult waterGetColorDetail(WaterDefinition* definition, Renderer* renderer, Vector3 location, Vector3 look);
|
|
|
|
Color waterGetColor(WaterDefinition* definition, Renderer* renderer, Vector3 location, Vector3 look);
|
2012-01-29 21:45:58 +00:00
|
|
|
void waterRender(WaterDefinition* definition, Renderer* renderer);
|
2011-12-10 13:25:22 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
#endif
|