Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10254 in orxonox.OLD for branches/camera


Ignore:
Timestamp:
Jan 17, 2007, 1:53:58 PM (18 years ago)
Author:
gfilip
Message:

hm…..

Location:
branches/camera/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/camera/src/world_entities/blackscreen.cc

    r10238 r10254  
    5050  if( root != NULL)
    5151    this->loadParams(root);
    52   i=0.5;
    53   state=0;
     52
    5453}
    5554
     
    7271  this->material = new Material();
    7372  this->material->setIllum(3);
    74   this->material->setDiffuse(1.0,1.0,1.0);
     73  this->material->setDiffuse(0,0,0);
    7574  this->material->setSpecular(0.0,0.0,0.0);
    76   this->material->setAmbient(1.0, 1.0, 1.0);
     75  this->material->setAmbient(0, 0, 0);
     76
     77  i=0.5;
     78  state=0;
     79  fadeSpeed=1;
    7780
    7881}
     
    146149void blackscreen::tick (float time)
    147150{
    148   if (state==0 && i==1)
    149     i=0;
    150   if (state==1 && i<=1)
    151     i=i+0.005;
     151/*if (state == true)
     152  fadeOut();
     153else
     154  fadeIn();*/
    152155}
    153156
     157void blackscreen::fadeIn()
     158{
     159  if (i>0)
     160    i=i-0.005*fadeSpeed;
     161}
    154162
    155 void  blackscreen::changeState (bool sta)
     163void blackscreen::fadeOut()
    156164{
    157   state=sta;
     165  if (i<=1)
     166    i=i+0.005*fadeSpeed;
    158167}
     168
     169void  blackscreen::toggleFade ()
     170{
     171  state=!state;
     172}
     173
     174void blackscreen::changeFadeSpeed(float newSpeed)
     175{
     176  fadeSpeed=newSpeed;
     177}
     178
  • branches/camera/src/world_entities/blackscreen.h

    r10212 r10254  
    1616    bool state;
    1717    Material*       material;
     18    void fadeIn();
     19    void fadeOut();
     20    float fadeSpeed;
    1821
    1922  public:
     
    2528    virtual void loadParams(const TiXmlElement* root);
    2629
    27     void changeState (bool);
     30    void toggleFade ();
     31    void changeFadeSpeed(float newSpeed);
    2832    virtual void tick (float time);
     33
    2934    virtual void draw() const;
    3035
  • branches/camera/src/world_entities/cameraman.cc

    r10238 r10254  
    2424cameraman::cameraman()
    2525{
    26   cout << "TTTT*" << cameras.size();
    2726  currentCam=State::getCamera();
    2827  this->cameras.push_back(currentCam);
    2928  currentCam->target->detach();
    30   cout << "TTTT*" << cameras.size();
    3129  State::setCamera(currentCam, currentCam->getTarget());
    3230}
     
    3735 // Camera* newCamera=new Camera();
    3836  this->cameras.push_back(new Camera());
    39   //cameras[cameras.size()-1]->target->detach();
     37  cameras[cameras.size()-1]->target->detach();
    4038
    4139}
     
    5452}
    5553
     54
     55void cameraman::testCam()
     56{
     57cameras[1]->lookAt(currentCam->getTarget());
     58cameras[1]->setParentSoft(currentCam->getParent());
     59}
    5660
    5761
  • branches/camera/src/world_entities/cameraman.h

    r10236 r10254  
    2626    void jumpCurrCam(int x, int y, int z);
    2727    void changeSpeed(float speed);
    28 
     28    void testCam();
    2929
    3030
Note: See TracChangeset for help on using the changeset viewer.