Changeset 10254 in orxonox.OLD for branches/camera
- Timestamp:
- Jan 17, 2007, 1:53:58 PM (18 years ago)
- Location:
- branches/camera/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/world_entities/blackscreen.cc
r10238 r10254 50 50 if( root != NULL) 51 51 this->loadParams(root); 52 i=0.5; 53 state=0; 52 54 53 } 55 54 … … 72 71 this->material = new Material(); 73 72 this->material->setIllum(3); 74 this->material->setDiffuse( 1.0,1.0,1.0);73 this->material->setDiffuse(0,0,0); 75 74 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; 77 80 78 81 } … … 146 149 void blackscreen::tick (float time) 147 150 { 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(); 153 else 154 fadeIn();*/ 152 155 } 153 156 157 void blackscreen::fadeIn() 158 { 159 if (i>0) 160 i=i-0.005*fadeSpeed; 161 } 154 162 155 void blackscreen::changeState (bool sta)163 void blackscreen::fadeOut() 156 164 { 157 state=sta; 165 if (i<=1) 166 i=i+0.005*fadeSpeed; 158 167 } 168 169 void blackscreen::toggleFade () 170 { 171 state=!state; 172 } 173 174 void blackscreen::changeFadeSpeed(float newSpeed) 175 { 176 fadeSpeed=newSpeed; 177 } 178 -
branches/camera/src/world_entities/blackscreen.h
r10212 r10254 16 16 bool state; 17 17 Material* material; 18 void fadeIn(); 19 void fadeOut(); 20 float fadeSpeed; 18 21 19 22 public: … … 25 28 virtual void loadParams(const TiXmlElement* root); 26 29 27 void changeState (bool); 30 void toggleFade (); 31 void changeFadeSpeed(float newSpeed); 28 32 virtual void tick (float time); 33 29 34 virtual void draw() const; 30 35 -
branches/camera/src/world_entities/cameraman.cc
r10238 r10254 24 24 cameraman::cameraman() 25 25 { 26 cout << "TTTT*" << cameras.size();27 26 currentCam=State::getCamera(); 28 27 this->cameras.push_back(currentCam); 29 28 currentCam->target->detach(); 30 cout << "TTTT*" << cameras.size();31 29 State::setCamera(currentCam, currentCam->getTarget()); 32 30 } … … 37 35 // Camera* newCamera=new Camera(); 38 36 this->cameras.push_back(new Camera()); 39 //cameras[cameras.size()-1]->target->detach();37 cameras[cameras.size()-1]->target->detach(); 40 38 41 39 } … … 54 52 } 55 53 54 55 void cameraman::testCam() 56 { 57 cameras[1]->lookAt(currentCam->getTarget()); 58 cameras[1]->setParentSoft(currentCam->getParent()); 59 } 56 60 57 61 -
branches/camera/src/world_entities/cameraman.h
r10236 r10254 26 26 void jumpCurrCam(int x, int y, int z); 27 27 void changeSpeed(float speed); 28 28 void testCam(); 29 29 30 30
Note: See TracChangeset
for help on using the changeset viewer.