Line | |
---|
1 | /*! |
---|
2 | * @file mapped_water.h |
---|
3 | * |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _MAPPED_WATER_H |
---|
7 | #define _MAPPED_WATER_H |
---|
8 | |
---|
9 | /* INCLUDES */ |
---|
10 | #include "world_entity.h" |
---|
11 | #include "material.h" |
---|
12 | #include "shader.h" |
---|
13 | |
---|
14 | class MappedWater : public WorldEntity |
---|
15 | { |
---|
16 | public: |
---|
17 | MappedWater(const TiXmlElement* root = NULL); |
---|
18 | virtual ~MappedWater(); |
---|
19 | |
---|
20 | void loadParams(const TiXmlElement* root); |
---|
21 | |
---|
22 | |
---|
23 | void activateReflection(); |
---|
24 | void deactivateReflection(); |
---|
25 | |
---|
26 | void activateRefraction(); |
---|
27 | void deactivateRefraction(); |
---|
28 | |
---|
29 | void draw() const; |
---|
30 | void tick(float dt); |
---|
31 | |
---|
32 | private: |
---|
33 | void setLightPosition(float x, float y, float z) { this->lightPos = Vector(x,y,z); }; |
---|
34 | void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); }; |
---|
35 | |
---|
36 | private: |
---|
37 | Vector waterPos; //!< position of the water |
---|
38 | Vector lightPos; //!< position of the light that is used to render the reflection |
---|
39 | |
---|
40 | float move; //!< textures coords, speeds, positions for the shaded textures.... |
---|
41 | float move2; //!< |
---|
42 | float g_WaterUV; //!< |
---|
43 | float g_WaterFlow; //!< |
---|
44 | float refrUV; //!< |
---|
45 | float normalUV; //!< |
---|
46 | float kNormalMapScale; //!< |
---|
47 | |
---|
48 | int textureSize; //!< height and width of the texture |
---|
49 | Material mat; |
---|
50 | Shader* shader; |
---|
51 | Shader::Uniform* cam_uni; //!< uniform that is used for the camera position |
---|
52 | |
---|
53 | }; |
---|
54 | |
---|
55 | #endif /* _MAPPED_WATER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.