Changeset 3729 in orxonox.OLD for orxonox/trunk/src/simple_animation.cc
- Timestamp:
- Apr 5, 2005, 11:51:15 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/simple_animation.cc
r3727 r3729 19 19 #include "simple_animation.h" 20 20 #include "stdincl.h" 21 #include "p_node.h"22 21 #include "vector.h" 22 #include "world_entity.h" 23 23 24 24 using namespace std; … … 51 51 52 52 this->tmpVect = new Vector(); 53 this->lastPosition = new Vector(); 53 54 } 54 55 … … 78 79 will be closed with AnimatiorEnd() 79 80 */ 80 void SimpleAnimation:: AnimatorBegin()81 void SimpleAnimation::animatorBegin() 81 82 { 82 83 this->bDescriptive = true; … … 90 91 will be closed with AnimatiorEnd() 91 92 */ 92 void SimpleAnimation:: AnimatorEnd()93 void SimpleAnimation::animatorEnd() 93 94 { 94 95 this->workingObject = NULL; … … 111 112 \brief adds a keyframe with properties 112 113 \param the point of the object 113 \param and the orientation of it114 \param and the direction of it 114 115 \param at this time 115 116 */ 116 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time)117 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* direction, float time) 117 118 { 118 119 if( !this->bDescriptive) … … 123 124 KeyFrame* frame = new KeyFrame; 124 125 frame->position = point; 125 frame-> orientation = orientation;126 frame->direction = direction; 126 127 frame->time = time; 127 128 frame->mode = DEFAULT_ANIMATION_MODE; … … 134 135 \brief adds a keyframe with properties 135 136 \param the point of the object 136 \param and the orientation of it137 \param and the direction of it 137 138 \param at this time 138 139 \param function of the velocity of the movement 139 140 */ 140 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode)141 void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode) 141 142 { 142 143 if( !this->bDescriptive) … … 147 148 KeyFrame* frame = new KeyFrame; 148 149 frame->position = point; 149 frame-> orientation = orientation;150 frame->direction = direction; 150 151 frame->time = time; 151 152 frame->mode = mode; … … 259 260 while( this->localTime > this->currentFrame->time) 260 261 { 261 printf("SimpleAnimation::tick(...) - changing Frame"); 262 printf("SimpleAnimation::tick(...) - changing Frame\n"); 263 this->localTime -= this->currentFrame->time; 264 265 this->lastPosition = this->currentFrame->position; 262 266 this->lastFrame = this->currentFrame; 263 267 this->currentFrame = this->frames->nextElement(this->currentFrame); 264 this->localTime -= this->currentFrame->time;265 268 } 266 269 … … 273 276 *this->tmpVect = *this->currentFrame->position - *this->lastFrame->position; 274 277 *this->tmpVect = *this->tmpVect * this->localTime / this->currentFrame->time; 275 //this->setAbsCoordinate(this->tmpVect); 278 this->currentFrame->object->shiftCoor(*this->tmpVect - *this->lastPosition); 279 *this->lastPosition = *this->tmpVect; 276 280 break; 277 281 case EXP:
Note: See TracChangeset
for help on using the changeset viewer.