- Timestamp:
- Apr 26, 2005, 3:16:28 AM (20 years ago)
- Location:
- orxonox/trunk/src/util/animation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/animation/animation3d.cc
r3980 r3981 117 117 118 118 tmpKeyFrame->position = position; 119 //tmpKeyFrame->lastPosition = position; 119 120 tmpKeyFrame->direction = direction; 120 121 tmpKeyFrame->duration = duration; … … 170 171 case ANIM_LINEAR: 171 172 this->animFuncMov = &Animation3D::mLinear; 173 this->object->setRelCoor(this->currentKeyFrame->position); 174 this->currentKeyFrame->lastPosition = Vector(); 172 175 break; 173 176 case ANIM_SINE: … … 219 222 void Animation3D::mLinear(float timePassed) const 220 223 { 221 this->object->setRelCoor(this->currentKeyFrame->position +222 (this->nextKeyFrame->position - this->currentKeyFrame->position) * 223 (timePassed/this->currentKeyFrame->duration));224 Vector v = (this->nextKeyFrame->position - this->currentKeyFrame->position) * (timePassed/this->currentKeyFrame->duration); 225 this->object->shiftCoor(v - this->currentKeyFrame->lastPosition); 226 this->currentKeyFrame->lastPosition = v; 224 227 } 225 228 -
orxonox/trunk/src/util/animation/animation3d.h
r3979 r3981 18 18 float duration; //!< The duration of this KeyFrame 19 19 Vector position; //!< The position of this KeyFrame 20 Vector lastPosition; 20 21 Quaternion direction; //!< The direction of this KeyFrame 21 22 ANIM_FUNCTION animFuncMov; //!< with whitch function to iterate movement to the next KeyFrame3D
Note: See TracChangeset
for help on using the changeset viewer.