2013-11-13 19:07:35 +00:00
|
|
|
#ifndef WATERDEFINITION_H
|
|
|
|
#define WATERDEFINITION_H
|
|
|
|
|
|
|
|
#include "definition_global.h"
|
|
|
|
|
2015-08-12 20:21:10 +00:00
|
|
|
#include "DefinitionNode.h"
|
2015-09-08 21:52:34 +00:00
|
|
|
#include "DefinitionWatcher.h"
|
2013-11-13 19:07:35 +00:00
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace definition {
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
class DEFINITIONSHARED_EXPORT WaterDefinition : public DefinitionNode, public DefinitionWatcher {
|
|
|
|
public:
|
|
|
|
WaterDefinition(DefinitionNode *parent);
|
2013-11-13 19:07:35 +00:00
|
|
|
virtual ~WaterDefinition();
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
virtual void save(PackStream *stream) const override;
|
|
|
|
virtual void load(PackStream *stream) override;
|
2013-11-13 19:07:35 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
virtual void copy(DefinitionNode *destination) const override;
|
2013-11-13 19:07:35 +00:00
|
|
|
virtual void validate() override;
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
inline IntNode *propModel() const {
|
|
|
|
return model;
|
|
|
|
}
|
|
|
|
inline FloatNode *propReflection() const {
|
|
|
|
return reflection;
|
|
|
|
}
|
|
|
|
inline FloatNode *propXOffset() const {
|
|
|
|
return xoffset;
|
|
|
|
}
|
|
|
|
inline FloatNode *propZOffset() const {
|
|
|
|
return zoffset;
|
|
|
|
}
|
2015-09-07 23:00:34 +00:00
|
|
|
|
2015-09-08 21:52:34 +00:00
|
|
|
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff);
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
typedef enum { WATER_PRESET_LAKE, WATER_PRESET_SEA } WaterPreset;
|
2015-12-10 18:40:39 +00:00
|
|
|
void applyPreset(WaterPreset preset, RandomGenerator &random = RandomGeneratorDefault);
|
2013-11-13 22:03:02 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
public:
|
2013-11-13 19:07:35 +00:00
|
|
|
double transparency;
|
2015-11-09 21:30:46 +00:00
|
|
|
SurfaceMaterial *material;
|
|
|
|
Color *depth_color;
|
2013-11-13 19:07:35 +00:00
|
|
|
double transparency_depth;
|
|
|
|
double lighting_depth;
|
|
|
|
|
|
|
|
double scaling;
|
|
|
|
double turbulence;
|
|
|
|
double waves_height;
|
|
|
|
double detail_height;
|
|
|
|
|
|
|
|
double foam_coverage;
|
2015-11-09 21:30:46 +00:00
|
|
|
SurfaceMaterial *foam_material;
|
2013-11-13 19:07:35 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
NoiseState *noise_state;
|
2015-09-07 23:00:34 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
2015-09-08 21:52:34 +00:00
|
|
|
IntNode *model;
|
2015-09-07 23:00:34 +00:00
|
|
|
FloatNode *reflection;
|
2015-10-15 15:52:03 +00:00
|
|
|
FloatNode *xoffset;
|
|
|
|
FloatNode *zoffset;
|
2013-11-13 19:07:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // WATERDEFINITION_H
|