Changeset 3985 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Apr 26, 2005, 3:54:02 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/animation/animation3d.cc
r3984 r3985 178 178 case ANIM_LINEAR: 179 179 this->animFuncMov = &Animation3D::mLinear; 180 this->object->setRelCoor(this->currentKeyFrame->position);180 //this->object->setRelCoor(this->currentKeyFrame->position); 181 181 this->currentKeyFrame->lastPosition = Vector(); 182 182 break; 183 183 case ANIM_SINE: 184 184 this->animFuncMov = &Animation3D::mSine; 185 this->object->setRelCoor(this->currentKeyFrame->position);185 //this->object->setRelCoor(this->currentKeyFrame->position); 186 186 this->currentKeyFrame->lastPosition = Vector(); 187 187 break; 188 188 case ANIM_COSINE: 189 189 this->animFuncMov = &Animation3D::mCosine; 190 //this->object->setRelCoor(this->currentKeyFrame->position); 191 this->currentKeyFrame->lastPosition = Vector(); 190 192 break; 191 193 case ANIM_EXP: … … 244 246 void Animation3D::mSine(float timePassed) const 245 247 { 246 /*247 if( timePassed < this->currentKeyFrame->duration/2.0)248 this->object->setRelCoor( this->currentKeyFrame->position + (this->nextKeyFrame->position - this->currentKeyFrame->position) *249 sin( M_PI * timePassed /this->currentKeyFrame->duration) / 2.0);250 else251 this->object->setRelCoor( this->nextKeyFrame->position - (this->nextKeyFrame->position - this->currentKeyFrame->position) *252 sin( M_PI * (1.0 - timePassed /this->currentKeyFrame->duration) )/2.0);253 */254 248 Vector v; 255 249 if( timePassed < this->currentKeyFrame->duration/2.0) … … 271 265 void Animation3D::mCosine(float timePassed) const 272 266 { 267 Vector v; 268 v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (1.0 + cos( M_PI * timePassed / this->currentKeyFrame->duration))/2.0; 269 this->object->shiftCoor(v - this->currentKeyFrame->lastPosition); 270 this->currentKeyFrame->lastPosition = v; 271 272 273 /* 273 274 this->object->setRelCoor( this->nextKeyFrame->position - 274 275 (this->nextKeyFrame->position - this->currentKeyFrame->position) * 275 276 (1.0 + cos( M_PI * timePassed / this->currentKeyFrame->duration))/2.0); 277 */ 276 278 } 277 279
Note: See TracChangeset
for help on using the changeset viewer.