Changeset 3729 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Apr 5, 2005, 11:51:15 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/glmenu/glmenu_imagescreen.cc
r3678 r3729 114 114 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 115 115 116 117 //PRINTF()(); 118 printf("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 116 PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 119 117 this->currentValue, this->maxValue); 120 118 -
orxonox/trunk/src/lib/coord/p_node.cc
r3687 r3729 565 565 this->time = dt; 566 566 PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate->x, this->absCoordinate->y, this->absCoordinate->z); 567 // printf("%s", this->objectName);568 567 if(this->mode & PNODE_MOVEMENT ) 569 568 { -
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: -
orxonox/trunk/src/simple_animation.h
r3727 r3729 25 25 //! KeyFrame Struct 26 26 /** 27 This represents one point with orientation of the animation27 This represents one point with direction of the animation 28 28 */ 29 29 typedef struct KeyFrame { 30 30 Vector* position; 31 Quaternion* orientation;31 Quaternion* direction; 32 32 WorldEntity* object; 33 33 float time; … … 45 45 static SimpleAnimation* getInstance(); 46 46 47 void AnimatorBegin();48 void AnimatorEnd();47 void animatorBegin(); 48 void animatorEnd(); 49 49 void selectObject(WorldEntity* entity); 50 void addKeyFrame(Vector* point, Quaternion* orientation, float time);51 void addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode);50 void addKeyFrame(Vector* point, Quaternion* direction, float time); 51 void addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode); 52 52 void addKeyFrame(KeyFrame* frame); 53 53 void reset(); … … 71 71 KeyFrame* currentFrame; //<! the frame that is been played now 72 72 KeyFrame* lastFrame; 73 Vector* lastPosition; 73 74 movementMode mode; //<! this is an enum of the mode, how the speed is distributed 74 75 float localTime; -
orxonox/trunk/src/story_entities/world.cc
r3727 r3729 35 35 #include "track_manager.h" 36 36 #include "garbage_collector.h" 37 #include "simple_animation.h" 37 38 38 39 #include "command_node.h" … … 155 156 delete this->lightMan; 156 157 delete this->trackManager; 158 159 //delete garbagecollecor 160 //delete animator 157 161 } 158 162 … … 188 192 wi->init(this); 189 193 this->garbageCollector = GarbageCollector::getInstance(); 194 this->simpleAnimation = SimpleAnimation::getInstance(); 190 195 } 191 196 … … 394 399 case DEBUG_WORLD_2: 395 400 { 401 lightMan->setAmbientColor(.1,.1,.1); 402 lightMan->addLight(); 396 403 lightMan->setPosition(-5.0, 10.0, -40.0); 397 404 this->nullParent = NullParent::getInstance (); … … 434 441 this->glmis->step(); 435 442 436 437 WorldEntity* env = new Environment(); 438 env->setName ("env"); 439 this->spawn(env); 440 443 444 WorldEntity* a = new Environment(); 445 this->spawn(a, new Vector(200.0, -35.0, 5.0), new Quaternion()); 446 447 WorldEntity* b = new Environment(); 448 this->localPlayer->addChild(b); 449 b->setRelCoor(new Vector(10.0, 0.0, 0.0)); 450 this->spawn(b); 441 451 452 this->simpleAnimation = SimpleAnimation::getInstance(); 453 454 /* 455 frame->position = point; 456 frame->orientation = orientation; 457 frame->time = time; 458 frame->mode = DEFAULT_ANIMATION_MODE; 459 */ 460 461 KeyFrame* f1 = new KeyFrame; 462 f1->position = new Vector(10.0, 1.0, 1.0); 463 f1->direction = new Quaternion(); 464 f1->time = 1.0; 465 f1->mode = LINEAR; 466 467 468 KeyFrame* f2 = new KeyFrame; 469 f2->position = new Vector(10.0, 1.0, -1.0); 470 f2->direction = new Quaternion(); 471 f2->time = 1.0; 472 f2->mode = LINEAR; 473 474 this->simpleAnimation->animatorBegin(); 475 this->simpleAnimation->selectObject(b); 476 this->simpleAnimation->addKeyFrame(f1); 477 this->simpleAnimation->addKeyFrame(f2); 478 this->simpleAnimation->animatorEnd(); 479 480 this->simpleAnimation->start(); 481 442 482 /* 443 483 Vector* es = new Vector (10, 5, 0); … … 850 890 this->localCamera->tick(this->dt); 851 891 this->garbageCollector->tick(seconds); 892 this->simpleAnimation->tick(seconds); 852 893 } 853 894 this->lastFrame = currentFrame; -
orxonox/trunk/src/world_entities/environment.cc
r3672 r3729 29 29 Environment::Environment () : WorldEntity() 30 30 { 31 this->model = (Model*) ResourceManager::getInstance()->load(" models/reaplow.obj", OBJ);31 this->model = (Model*) ResourceManager::getInstance()->load("sphere", RP_LEVEL); 32 32 // this->model = new OBJModel("../data/models/fighter.obj"); 33 33 }
Note: See TracChangeset
for help on using the changeset viewer.