Changeset 3968 in orxonox.OLD for orxonox/trunk/src/util/animation
- Timestamp:
- Apr 26, 2005, 12:37:06 AM (20 years ago)
- Location:
- orxonox/trunk/src/util/animation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/animation/animation3d.cc
r3967 r3968 131 131 this->nextKeyFrame = this->keyFrameList->nextElement(this->currentKeyFrame); 132 132 this->setAnimFunc(this->currentKeyFrame->animFunc); 133 134 if( this->currentKeyFrame->animFunc == ANIM_NEG_EXP)135 {136 137 }138 133 } 139 140 134 /* now animate it */ 141 135 (this->*animFunc)(this->localTime); 142 /* 143 switch( this->movMode) 144 { 145 case LINEAR: 146 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 147 *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time; 148 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 149 *this->lastPosition = *this->tmpVect; 150 break; 151 case EXP: 152 153 break; 154 case NEG_EXP: 155 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 156 *this->tmpVect = *this->tmpVect * (1 - expf(- this->localTime * this->deltaT)); 157 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 158 *this->lastPosition = *this->tmpVect; 159 break; 160 case SIN: 161 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 162 *this->tmpVect = *this->tmpVect * 0.5*(1 - cos(M_PI * this->localTime / this->currentFrame->time)); 163 this->currentFrame->object->setRelCoor(*this->lastFrame->position + *this->tmpVect); 164 *this->lastPosition = *this->tmpVect; 165 break; 166 case COS: 167 168 break; 169 case QUADRATIC: 170 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 171 *this->tmpVect = *this->tmpVect * 1/3 * ldexpf(this->localTime, 3); 172 break; 173 default: 174 break; 175 } 176 */ 136 177 137 } 178 138 } … … 205 165 case ANIM_NEG_EXP: 206 166 this->animFunc = &Animation3D::negExp; 207 //this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;208 //this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());209 167 this->expFactor = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D); 210 //(this->currentKeyFrame->position - this->nextKeyFrame->position)211 212 /*213 float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);214 expFactor = - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);215 216 */217 168 break; 218 169 case ANIM_QUADRATIC: … … 282 233 (this->nextKeyFrame->position - this->currentKeyFrame->position) * 283 234 (1.0 + cos( M_PI * timePassed / this->currentKeyFrame->duration))/2.0); 284 285 235 } 286 236 … … 298 248 void Animation3D::exp(float timePassed) const 299 249 { 250 PRINTF(0)("no exp animation3d defined\n"); 300 251 this->linear(timePassed); 301 252 } … … 321 272 void Animation3D::quadratic(float timePassed) const 322 273 { 274 PRINTF(0)("no quadratic animation3d defined\n"); 323 275 this->linear(timePassed); 324 276 } -
orxonox/trunk/src/util/animation/t_animation.h
r3876 r3968 235 235 { 236 236 this->animFunc = &tAnimation<T>::negExp; 237 float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);238 237 expFactor = - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X); 239 238 break;
Note: See TracChangeset
for help on using the changeset viewer.