paysages3d/src/definition/WaterDefinition.h

68 lines
1.6 KiB
C
Raw Normal View History

2013-11-13 19:07:35 +00:00
#ifndef WATERDEFINITION_H
#define WATERDEFINITION_H
#include "definition_global.h"
#include "DefinitionNode.h"
#include "DefinitionWatcher.h"
2013-11-13 19:07:35 +00:00
namespace paysages {
namespace definition {
class DEFINITIONSHARED_EXPORT WaterDefinition : public DefinitionNode, public DefinitionWatcher {
public:
WaterDefinition(DefinitionNode *parent);
2013-11-13 19:07:35 +00:00
virtual ~WaterDefinition();
virtual void save(PackStream *stream) const override;
virtual void load(PackStream *stream) override;
2013-11-13 19:07:35 +00:00
virtual void copy(DefinitionNode *destination) const override;
2013-11-13 19:07:35 +00:00
virtual void validate() override;
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
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff);
typedef enum { WATER_PRESET_LAKE, WATER_PRESET_SEA } WaterPreset;
void applyPreset(WaterPreset preset, RandomGenerator &random = RandomGeneratorDefault);
public:
2013-11-13 19:07:35 +00:00
double transparency;
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;
SurfaceMaterial *foam_material;
2013-11-13 19:07:35 +00:00
NoiseState *noise_state;
2015-09-07 23:00:34 +00:00
private:
IntNode *model;
2015-09-07 23:00:34 +00:00
FloatNode *reflection;
FloatNode *xoffset;
FloatNode *zoffset;
2013-11-13 19:07:35 +00:00
};
}
}
#endif // WATERDEFINITION_H