Changeset 3986 in orxonox.OLD for orxonox/trunk/src/util
- Timestamp:
- Apr 26, 2005, 12:38:20 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/animation/animation3d.cc
r3985 r3986 46 46 this->animFuncMov = &Animation3D::mLinear; 47 47 this->animFuncRot = &Animation3D::rLinear; 48 49 this->bRunning = false; 48 50 } 49 51 … … 172 174 switch (animFuncMov) 173 175 { 174 default:175 176 case ANIM_CONSTANT: 176 177 this->animFuncMov = &Animation3D::mConstant; … … 197 198 this->animFuncMov = &Animation3D::mNegExp; 198 199 this->expFactorMov = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D); 200 this->currentKeyFrame->lastPosition = Vector(); 199 201 break; 200 202 case ANIM_QUADRATIC: … … 204 206 this->animFuncMov = &Animation3D::mRandom; 205 207 break; 208 default: 209 break; 206 210 } 207 211 } … … 215 219 void Animation3D::mConstant(float timePassed) const 216 220 { 217 this->object->setRelCoor(this->currentKeyFrame->position);221 //this->object->setRelCoor(this->currentKeyFrame->position); 218 222 219 223 /* … … 296 300 void Animation3D::mNegExp(float timePassed) const 297 301 { 302 Vector v; 303 v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (1.0 - expf(- timePassed * expFactorMov)); 304 this->object->shiftCoor(v - this->currentKeyFrame->lastPosition); 305 this->currentKeyFrame->lastPosition = v; 306 307 /* 298 308 this->object->setRelCoor( this->currentKeyFrame->position + 299 309 (this->nextKeyFrame->position - this->currentKeyFrame->position) * 300 310 (1.0 - expf(- timePassed * expFactorMov)) ); 311 */ 301 312 } 302 313 … … 320 331 void Animation3D::mRandom(float timePassed) const 321 332 { 333 /* 322 334 this->object->setRelCoor(this->currentKeyFrame->position + 323 335 (this->nextKeyFrame->position - this->currentKeyFrame->position) * (float)rand()/(float)RAND_MAX); 324 336 this->object->setRelDir(this->currentKeyFrame->direction + 325 337 (this->nextKeyFrame->direction - this->currentKeyFrame->direction)* (float)rand()/(float)RAND_MAX); 338 */ 326 339 } 327 340 … … 338 351 switch (animFuncRot) 339 352 { 340 default:353 default: 341 354 case ANIM_CONSTANT: 342 355 this->animFuncRot = &Animation3D::rConstant; 356 printf("a;sdlfkja;lskdjf;alskjdf;lasjdf;lasjdf;lasjdf;lajsdf\n"); 343 357 break; 344 358 case ANIM_LINEAR: … … 364 378 this->animFuncRot = &Animation3D::rRandom; 365 379 break; 380 366 381 } 367 382 }
Note: See TracChangeset
for help on using the changeset viewer.