- Timestamp:
- Apr 5, 2005, 1:07:47 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.cc
r3719 r3720 20 20 #include "stdincl.h" 21 21 #include "p_node.h" 22 #include "vector.h" 22 23 23 24 using namespace std; … … 104 105 this->currentFrame = NULL; 105 106 this->lastFrame = NULL; 107 108 this->tmpVect = new Vector(); 106 109 } 107 110 … … 253 256 { 254 257 printf("SimpleAnimation::tick(...) - changing Frame"); 258 this->lastFrame = this->currentFrame; 255 259 this->currentFrame = this->frames->nextElement(this->currentFrame); 256 260 this->localTime -= this->currentFrame->time; … … 258 262 259 263 260 261 264 /* now animate it */ 262 265 switch( this->mode) 263 266 { 264 267 case LINEAR: 265 268 269 *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor(); 270 *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time; 271 //this->setAbsCoordinate(this->tmpVect); 266 272 break; 267 273 case EXP: … … 269 275 break; 270 276 case NEG_EXP: 271 277 *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor(); 278 *this->tmpVect = *this->tmpVect * (1 - exp(- this->localTime / this->currentFrame->time)); 272 279 break; 273 280 case SIN: 274 281 *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor(); 282 *this->tmpVect = *this->tmpVect * (1 - cos(- this->localTime / this->currentFrame->time)); 275 283 break; 276 284 case COS: … … 278 286 break; 279 287 case QUADRATIC: 280 288 *this->tmpVect = this->currentFrame->getAbsCoor() - this->lastFrame->getAbsCoor(); 289 *this->tmpVect = *this->tmpVect * 1/3 * ldexpf(this->localTime, 3); 281 290 break; 282 291 default: -
orxonox/trunk/src/simple_animation.h
r3719 r3720 69 69 PNode* parent; 70 70 71 Vector* tmpVect; //<! this is the temporary vector save place 71 72 72 73 };
Note: See TracChangeset
for help on using the changeset viewer.