Changeset 3786 in orxonox.OLD for orxonox/branches/textEngine/src/animation.cc
- Timestamp:
- Apr 13, 2005, 2:17:16 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/animation.cc
r3785 r3786 33 33 34 34 // setting default values 35 this->localTime = 0.0; 35 36 this->animFunc = &Anim::linear; 36 37 this->currentKeyFrame = tmpKeyFrame; … … 70 71 if (this->currentKeyFrame == this->nextKeyFrame) 71 72 this->nextKeyFrame = tmpKeyFrame; 73 this->keyFrameList->add(tmpKeyFrame); 74 72 75 } 73 76 else … … 80 83 tmpKeyFrame->animFunc = animFunc; 81 84 82 this->keyFrameList->add(tmpKeyFrame);83 85 } 84 86 … … 106 108 this->animFunc = &Anim::sine; 107 109 break; 108 109 110 } 110 111 } … … 112 113 113 114 // animation functions 114 float Anim::random(float time ) const115 float Anim::random(float timePassed) const 115 116 { 116 117 return (float)rand()/(float)RAND_MAX; 117 118 } 118 119 119 float Anim::constant(float time ) const120 float Anim::constant(float timePassed) const 120 121 { 121 122 return this->currentKeyFrame->value; 122 123 } 123 124 124 float Anim::linear(float time ) const125 float Anim::linear(float timePassed) const 125 126 { 126 127 return this->nextKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value) 127 * (time *100.0/ this->currentKeyFrame->duration);128 * (timePassed / this->currentKeyFrame->duration); 128 129 // PRINTF(0)("value is %f, %p %p\n", val, this->currentKeyFrame, this->nextKeyFrame); 129 130 // return val; 130 131 } 131 132 132 float Anim::sine(float time ) const133 float Anim::sine(float timePassed) const 133 134 { 134 135 135 136 }
Note: See TracChangeset
for help on using the changeset viewer.