Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/world_entities/environments/water.h @ 9715

Last change on this file since 9715 was 9715, checked in by bensch, 18 years ago

renamed newclassid to classid and newobjectlist to objectlist

File size: 2.1 KB
Line 
1/*!
2 * @file water.h
3 *  Definition of the SkyBox, that handles the Display of an atmosphere for orxonox.
4 *
5 * A SkyBox is always centered at the current working Camera, and will only obey the cameras
6 * movment but not its rotation.
7*/
8
9#ifndef _WATER_H
10#define _WATER_H
11
12/* INCLUDES */
13#include "world_entity.h"
14#include "material.h"
15
16
17/* FORWARD DECLARATION */
18class Grid;
19class Shader;
20
21//! A Class to handle a WaterEffects
22class Water : public WorldEntity
23{
24  ObjectListDeclaration(Water);
25  public:
26   Water(const TiXmlElement* root = NULL);
27   virtual ~Water();
28
29   void loadParams(const TiXmlElement* root);
30
31   void setResolution(unsigned int resX, unsigned int resY);
32   void setSize(float sizeX, float sizeY);
33   void setHeight(float height);
34   void rebuildGrid();
35
36   void wave(float x, float y, float z, float force);
37   inline void wave(Vector pos, float force) { this->wave(pos.x, pos.y, pos.z, force); };
38
39   void draw() const;
40   void tick(float dt);
41
42   virtual void varChangeHandler( std::list<int> & id );
43
44  private:
45    bool posToGridPoint(float x, float z, unsigned int& row, unsigned int& column);
46
47  private:
48    Grid*           grid;            //!< The water-surface-model to render with
49    float**         velocities;      //!< Velocities.
50    float           viscosity;       //!< Viscosity (bigger more like honey, smaller more like water).
51    float           cohesion;        //!< Cohesion.
52
53    Material        waterMaterial;
54    Shader*         waterShader;
55
56    float           height;          //!< The hight of the Water
57    int             height_handle;   //!< Handle to notify about changes of height
58
59    unsigned int    resX, resY;      //!< Grid resolution
60    int             resX_handle;     //!< Handle to notify about changes of resX
61    int             resY_handle;     //!< Handle to notify about changes of resY
62    float           sizeX, sizeY;    //!< waters size
63    int             sizeX_handle;    //!< Handle to notify about changes of sizeX
64    int             sizeY_handle;    //!< Handle to notify about changes of sizeY
65
66    float phase;
67};
68
69#endif  /* _WATER_H */
70
71
72
Note: See TracBrowser for help on using the repository browser.