Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 9, 2006, 11:53:53 PM (18 years ago)
Author:
bensch
Message:

trunk: Simple water surface WE

Location:
trunk/src/world_entities/environments
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/environments/water.h

    r6451 r6455  
    11/*!
    2  * @file skybox.h
     2 * @file water.h
    33 *  Definition of the SkyBox, that handles the Display of an atmosphere for orxonox.
    44 *
     
    77*/
    88
    9 #ifndef _SKYBOX_H
    10 #define _SKYBOX_H
     9#ifndef _WATER_H
     10#define _WATER_H
    1111
    1212/* INCLUDES */
     
    1515/* FORWARD DECLARATION */
    1616class Material;
     17class Grid;
    1718
    18 //! A Class to handle a SkyBox
    19 class SkyBox : public WorldEntity
     19//! A Class to handle a WaterEffects
     20class Water : public WorldEntity
    2021{
    2122 public:
    22   SkyBox(const char* fileName = NULL);
    23   SkyBox(const TiXmlElement* root);
     23   Water(const TiXmlElement* root = NULL);
     24   ~Water();
    2425
    25   virtual ~SkyBox();
     26   void loadParams(const TiXmlElement* root);
    2627
    27   void init();
    28   void preInit();
     28   void setResolution(unsigned int resX, unsigned int resY);
     29   void setSize(float sizeX, float sizeY);
     30   void rebuildGrid();
    2931
    30   void loadParams(const TiXmlElement* root);
     32  private:
     33    Grid*           grid;            //!< The water-surface-model to render with
    3134
    32   void postInit();
    33 
    34 
    35   void setSize(float size);
    36   /** assumes jpg as input-format */
    37   void setTexture(const char* name) { if (textureName) delete[] textureName; textureName = new char[strlen(name)+1]; strcpy(textureName, name); this->setTextureAndType (name, "jpg"); };
    38 
    39   void setTextureAndType(const char* name, const char* extension);
    40   void setTextures(const char* top, const char* bottom, const char* left,
    41                    const char* right, const char* front, const char* back);
    42 
    43   virtual int       writeBytes(const byte* data, int length, int sender);
    44   virtual int       readBytes(byte* data, int maxLength, int * reciever);
    45   virtual void      writeDebug() const;
    46   virtual void      readDebug() const;
    47 
    48  private:
    49   void rebuild();
    50 
    51   Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    52   float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
    53   char*           textureName;     //!< Name of the Texture
    54 
     35    unsigned int    resX, resY;
     36    float           sizeX, sizeY;
    5537};
    5638
    57 #endif  /* _SKYBOX_H */
     39#endif  /* _WATER_H */
    5840
    5941
Note: See TracChangeset for help on using the changeset viewer.