2011-12-10 13:25:22 +00:00
|
|
|
#ifndef _PAYSAGES_WATER_H_
|
|
|
|
#define _PAYSAGES_WATER_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double height;
|
|
|
|
double transparency;
|
|
|
|
double reflection;
|
|
|
|
Color main_color;
|
2011-12-19 20:59:39 +00:00
|
|
|
Color depth_color;
|
|
|
|
double transparency_depth;
|
2012-01-17 20:54:14 +00:00
|
|
|
NoiseGenerator* waves_noise;
|
|
|
|
double waves_noise_height;
|
|
|
|
double waves_noise_scale;
|
2011-12-10 13:25:22 +00:00
|
|
|
} WaterDefinition;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
double detail_boost;
|
|
|
|
double force_detail;
|
|
|
|
} WaterQuality;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
RayCastingFunction reflection_function;
|
|
|
|
RayCastingFunction refraction_function;
|
|
|
|
int toggle_fog;
|
|
|
|
int toggle_shadows;
|
|
|
|
} WaterEnvironment;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
|
|
|
Color base;
|
|
|
|
Color reflected;
|
|
|
|
Color refracted;
|
|
|
|
Color final;
|
|
|
|
} WaterResult;
|
|
|
|
|
|
|
|
void waterInit();
|
|
|
|
void waterSave(FILE* f);
|
|
|
|
void waterLoad(FILE* f);
|
|
|
|
|
|
|
|
WaterDefinition waterCreateDefinition();
|
|
|
|
void waterDeleteDefinition(WaterDefinition definition);
|
|
|
|
void waterCopyDefinition(WaterDefinition source, WaterDefinition* destination);
|
|
|
|
void waterSetDefinition(WaterDefinition definition);
|
|
|
|
WaterDefinition waterGetDefinition();
|
|
|
|
void waterSetQuality(WaterQuality quality);
|
|
|
|
WaterQuality waterGetQuality();
|
|
|
|
|
|
|
|
double waterGetLightFactor(Vector3 location);
|
|
|
|
WaterResult waterGetColorCustom(Vector3 location, Vector3 look, WaterDefinition* definition, WaterQuality* quality, WaterEnvironment* environment);
|
|
|
|
Color waterGetColor(Vector3 location, Vector3 look);
|
|
|
|
void waterRender(RenderProgressCallback callback);
|
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-10 13:25:22 +00:00
|
|
|
#endif
|