/*! * @file water.h * Definition of the SkyBox, that handles the Display of an atmosphere for orxonox. * * A SkyBox is always centered at the current working Camera, and will only obey the cameras * movment but not its rotation. */ #ifndef _WATER_H #define _WATER_H /* INCLUDES */ #include "world_entity.h" #include "material.h" /* FORWARD DECLARATION */ class Grid; class Shader; //! A Class to handle a WaterEffects class Water : public WorldEntity { public: Water(const TiXmlElement* root = NULL); virtual ~Water(); void loadParams(const TiXmlElement* root); void setResolution(unsigned int resX, unsigned int resY); void setSize(float sizeX, float sizeY); void setHeight(float height); void rebuildGrid(); void wave(float x, float y, float z, float force); inline void wave(Vector pos, float force) { this->wave(pos.x, pos.y, pos.z, force); }; void draw() const; void tick(float dt); virtual void varChangeHandler( std::list & id ); private: bool posToGridPoint(float x, float z, unsigned int& row, unsigned int& column); private: Grid* grid; //!< The water-surface-model to render with float** velocities; //!< Velocities. float viscosity; //!< Viscosity (bigger more like honey, smaller more like water). float cohesion; //!< Cohesion. Material waterMaterial; Shader* waterShader; float height; //!< The hight of the Water int height_handle; //!< Handle to notify about changes of height unsigned int resX, resY; //!< Grid resolution int resX_handle; //!< Handle to notify about changes of resX int resY_handle; //!< Handle to notify about changes of resY float sizeX, sizeY; //!< waters size int sizeX_handle; //!< Handle to notify about changes of sizeX int sizeY_handle; //!< Handle to notify about changes of sizeY float phase; }; #endif /* _WATER_H */