Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2006, 6:53:35 PM (18 years ago)
Author:
stefalie
Message:

mountain_lake: waterHeight fading works

File:
1 edited

Legend:

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

    r8916 r8918  
    2121#include "t_animation.h"
    2222#include "math.h"
    23 
    2423#include "glgui.h"
    25 
    26 
    2724#include "shell_command.h"
    2825
     
    5653  this->calcVerts();
    5754
    58   tempcounter = 0;
     55  // init gui
    5956  this->box = NULL;
    6057}
     
    10097  this->move = 0;
    10198  this->move2 = this->move * this->kNormalMapScale;
     99
     100  // initalize fading bools
     101  this->bFadeWaterHeight = false;
     102  this->bFadeWaterUV = false;
     103  this->bFadeWaterFlow = false;
     104  this->bFadeShineSize = false;
     105  this->bFadeShineStrength = false;
     106  this->bFadeReflStrength = false;
     107  this->bFadeRefraction = false;
     108
     109  this->tempcounter = 0;
    102110}
    103111
     
    323331      {
    324332        OrxGui::GLGuiInputLine* waterColorText = new OrxGui::GLGuiInputLine();
    325         waterColorText->setText("Color");
     333        waterColorText->setText("WaterColor");
    326334        waterColorBox->pack(waterColorText);
    327335
     
    335343        OrxGui::GLGuiSlider* waterColorG = new OrxGui::GLGuiSlider();
    336344        waterColorG->setRange(0, 1.0f);
    337         waterColorR->setStep(0.1f);
     345        waterColorG->setStep(0.1f);
    338346        waterColorG->setValue(this->waterColor.y);
    339347        waterColorG->connect(SIGNAL(waterColorG, valueChanged), this, SLOT(MappedWater, resetWaterColorG));
     
    342350        OrxGui::GLGuiSlider* waterColorB = new OrxGui::GLGuiSlider();
    343351        waterColorB->setRange(0, 1.0f);
    344         waterColorR->setStep(0.1f);
     352        waterColorB->setStep(0.1f);
    345353        waterColorB->setValue(this->waterColor.z);
    346354        waterColorB->connect(SIGNAL(waterColorB, valueChanged), this, SLOT(MappedWater, resetWaterColorB));
    347355        waterColorBox->pack(waterColorB);
    348 
    349356      }
    350357      this->box->pack(waterColorBox);
     
    440447      this->box->pack(refractionBox);
    441448
     449      OrxGui::GLGuiBox* lightPosBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     450      {
     451        OrxGui::GLGuiInputLine* lightPosText = new OrxGui::GLGuiInputLine();
     452        lightPosText->setText("LightPos");
     453        lightPosBox->pack(lightPosText);
     454
     455        OrxGui::GLGuiSlider* lightPosX = new OrxGui::GLGuiSlider();
     456        lightPosX->setRange(-600, 600);
     457        lightPosX->setValue(this->lightPos.x);
     458        lightPosX->setStep(15);
     459        lightPosX->connect(SIGNAL(lightPosX, valueChanged), this, SLOT(MappedWater, resetLightPosX));
     460        lightPosBox->pack(lightPosX);
     461
     462        OrxGui::GLGuiSlider* lightPosY = new OrxGui::GLGuiSlider();
     463        lightPosY->setRange(-600, 600);
     464        lightPosY->setStep(15);
     465        lightPosY->setValue(this->lightPos.y);
     466        lightPosY->connect(SIGNAL(lightPosY, valueChanged), this, SLOT(MappedWater, resetLightPosY));
     467        lightPosBox->pack(lightPosY);
     468
     469        OrxGui::GLGuiSlider* lightPosZ = new OrxGui::GLGuiSlider();
     470        lightPosZ->setRange(-600, 600);
     471        lightPosZ->setStep(15);
     472        lightPosZ->setValue(this->lightPos.z);
     473        lightPosZ->connect(SIGNAL(lightPosZ, valueChanged), this, SLOT(MappedWater, resetLightPosZ));
     474        lightPosBox->pack(lightPosZ);
     475      }
     476      this->box->pack(lightPosBox);
     477
     478      OrxGui::GLGuiBox* waterHeightBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     479      {
     480        OrxGui::GLGuiInputLine* waterHeightText = new OrxGui::GLGuiInputLine();
     481        waterHeightText->setText("WaterHeight");
     482        waterHeightBox->pack(waterHeightText);
     483
     484        OrxGui::GLGuiSlider* waterHeight = new OrxGui::GLGuiSlider();
     485        waterHeight->setRange(-500, 500);
     486        waterHeight->setValue(this->waterHeight);
     487        waterHeight->setStep(10);
     488        waterHeight->connect(SIGNAL(waterHeight, valueChanged), this, SLOT(MappedWater, setWaterHeight));
     489        waterHeightBox->pack(waterHeight);
     490      }
     491      this->box->pack(waterHeightBox);
    442492    }
     493
    443494    this->box->showAll();
    444495    this->box->setAbsCoor2D(300, 40);
     
    446497    OrxGui::GLGuiHandler::getInstance()->activateCursor();
    447498  }
    448 
    449 
    450499}
    451500
     
    598647  }
    599648
     649  if(bFadeWaterHeight)
     650  {
     651    this->waterHeightFader = new tAnimation<MappedWater>(this, &MappedWater::setWaterHeight);
     652    this->waterHeightFader->setInfinity(ANIM_INF_CONSTANT);
     653
     654    this->waterHeightFader->addKeyFrame(this->waterHeight, this->waterHeightFadeTime, ANIM_LINEAR);
     655    this->waterHeightFader->addKeyFrame(this->newWaterHeight, 0, ANIM_LINEAR);
     656
     657    bFadeWaterHeight = false;
     658    this->waterHeightFader->replay();
     659  }
     660
    600661
    601662//   if(this->tempcounter == 300)
     
    604665//     this->fadeWaterUV(1, 10);
    605666//   }
    606 //   if(this->tempcounter == 100)
    607 //   {
    608 //     PRINTF(0)("\n\n\n\n\n\n///////////////////////test waterchangecolor/////////////////////\n\n\n\n\n\n");
    609 //     this->fadeWaterFlow(1, 10);
    610 //   }
     667  if(this->tempcounter == 100)
     668  {
     669    PRINTF(0)("\n\n\n\n\n\n///////////////////////test waterchangecolor/////////////////////\n\n\n\n\n\n");
     670    this->fadeWaterHeight(0, 15);
     671  }
    611672  //PRINTF(0)("counter %i/n", tempcounter);
    612673  tempcounter++;
Note: See TracChangeset for help on using the changeset viewer.