Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8868 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 4:33:27 PM (18 years ago)
Author:
stefalie
Message:

mountain_lake: small cleanup, now lets get started with the fading functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mountain_lake/src/world_entities/environments/mapped_water.h

    r8867 r8868  
    3535  virtual ~MappedWater();
    3636
     37  // worldentity functions
    3738  void loadParams(const TiXmlElement* root);
    38 
    3939  void draw() const;
    4040  void tick(float dt);
     
    5151  void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; }
    5252  void setWaterAngle(float angle) { this->waterAngle = angle; }
     53  void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); this->newWaterColor = this->waterColor; }
    5354  void setWaterUV(float uv) { this->waterUV = uv; }
    5455  void setWaterFlow(float flow) { this->waterFlow = flow; };
     
    5859  void setReflStrength(float strength) { this->reflStrength = strength; }
    5960  void setRefraction(float refraction) { this->refraction = refraction; }
    60   void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); this->newWaterColor = this->waterColor; }
    6161
    6262  // functions to change water parameters during runtime
    6363  // to reset waterUV and waterFlow just use the normal set functions
     64  // don't reset kNormalMapScale (because it won't change anything)
     65  void resetLightPos(float x, float y, float z);
     66  void resetWaterPos(float x, float y, float z) { this->setWaterPos(x, y, z); this->calcVerts(); }
     67  void resetWaterSize(float x, float z) { this->setWaterSize(x, z); this->calcVerts(); }
     68  void resetWaterAngle(float angle) { this->setWaterAngle(angle); this->calcVerts(); }
    6469  void resetWaterColor(float r, float g, float b);
    6570  void resetShineSize(float shine);
     
    6772  void resetReflStrength(float strength);
    6873  void resetRefraction(float refraction);
    69   void resetLightPos(float x, float y, float z);
    70   void resetWaterPos(float x, float y, float z) { this->setWaterPos(x, y, z); this->calcVerts(); }
    71   void resetWaterSize(float x, float z) { this->setWaterSize(x, z); this->calcVerts(); }
    72   void resetWaterAngle(float angle) { this->setWaterAngle(angle); this->calcVerts(); }
    7374
    74   // fade functions
     75  // fade functions, hacky HACK
    7576  void fadeWaterColor(float r, float g, float b, float time) {this->newWaterColor = Vector(r, g, b); this->colorFadeTime = time; }
    7677  void fadeShininess(float shine, float time);
     
    8485
    8586private:
     87  Material            mat;
     88  Shader*             shader;
     89
     90  // water size and position
    8691  float               waterHeight;            //!< position of the water
    8792  float               waterVerts[8];          //!< coords of the 4 vertexes of the water quad
    8893  float               xWidth, zWidth;         //!< size of the water quad
    89   Vector              lightPos;               //!< position of the light that is used to render the reflection
    9094  float               waterAngle;             //!< defines how much the water will be turned around the point waterPos
    91   Vector              waterColor;             //!< color of the water
    9295
     96  // values for texture size, scale, texture coords
    9397  float               move;
    9498  float               move2;
     
    97101  float               normalUV;
    98102  float               kNormalMapScale;
     103  int                 textureSize;            //!< height and width of the texture
     104
     105  // values for the uniforms
     106  Vector              waterColor;             //!< color of the water
     107  Vector              lightPos;               //!< position of the light that is used to render the reflection
    99108  float               shineSize;              //!< the bigger the value, the smaller the specular reflection point
    100109  float               shineStrength;
     
    102111  float               refraction;
    103112
    104   int                 textureSize;            //!< height and width of the texture
    105   Material            mat;
    106   Shader*             shader;
     113  // uniforms
    107114  Shader::Uniform*    cam_uni;                //!< uniform that is used for the camera position
    108115  Shader::Uniform*    light_uni;              //!< uniform that is used for the light position
     
    113120  Shader::Uniform*    reflStrength_uni;       //!< uniform that is used for the strength of the reflection
    114121
    115 
     122  // skirmish HACK
    116123  Vector              newWaterColor;          //!< used to fade the water color
    117124  float               colorFadeTime;
Note: See TracChangeset for help on using the changeset viewer.