Changeset 3851 in orxonox.OLD for orxonox/trunk/src
- Timestamp:
- Apr 17, 2005, 1:21:59 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3812 r3851 34 34 track_node.cc \ 35 35 animation.cc \ 36 animation3d.cc \ 36 37 animation_player.cc \ 37 simple_animation.cc \38 38 garbage_collector.cc \ 39 39 story_entities/story_entity.cc \ … … 86 86 track_node.h \ 87 87 animation.h \ 88 t_animation.h \ 89 animation3d.h \ 88 90 animation_player.h \ 89 simple_animation.h \90 91 garbage_collector.h \ 91 92 story_entities/story_entity.h \ -
orxonox/trunk/src/Makefile.in
r3812 r3851 56 56 command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \ 57 57 track_manager.$(OBJEXT) track_node.$(OBJEXT) \ 58 animation.$(OBJEXT) animation _player.$(OBJEXT) \59 simple_animation.$(OBJEXT) garbage_collector.$(OBJEXT) \58 animation.$(OBJEXT) animation3d.$(OBJEXT) \ 59 animation_player.$(OBJEXT) garbage_collector.$(OBJEXT) \ 60 60 story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \ 61 61 world_entity.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \ … … 77 77 am__depfiles_maybe = depfiles 78 78 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/animation.Po \ 79 @AMDEP_TRUE@ ./$(DEPDIR)/animation3d.Po \ 79 80 @AMDEP_TRUE@ ./$(DEPDIR)/animation_player.Po \ 80 81 @AMDEP_TRUE@ ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \ … … 99 100 @AMDEP_TRUE@ ./$(DEPDIR)/projectile.Po \ 100 101 @AMDEP_TRUE@ ./$(DEPDIR)/resource_manager.Po \ 101 @AMDEP_TRUE@ ./$(DEPDIR)/satellite.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/simple_animation.Po \ 103 @AMDEP_TRUE@ ./$(DEPDIR)/skybox.Po ./$(DEPDIR)/skysphere.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/satellite.Po ./$(DEPDIR)/skybox.Po \ 103 @AMDEP_TRUE@ ./$(DEPDIR)/skysphere.Po \ 104 104 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/terrain.Po \ 105 105 @AMDEP_TRUE@ ./$(DEPDIR)/test_bullet.Po ./$(DEPDIR)/test_gun.Po \ … … 247 247 track_node.cc \ 248 248 animation.cc \ 249 animation3d.cc \ 249 250 animation_player.cc \ 250 simple_animation.cc \251 251 garbage_collector.cc \ 252 252 story_entities/story_entity.cc \ … … 299 299 track_node.h \ 300 300 animation.h \ 301 t_animation.h \ 302 animation3d.h \ 301 303 animation_player.h \ 302 simple_animation.h \303 304 garbage_collector.h \ 304 305 story_entities/story_entity.h \ … … 425 426 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@ 426 427 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation.Po@am__quote@ 428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation3d.Po@am__quote@ 427 429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation_player.Po@am__quote@ 428 430 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ … … 456 458 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@ 457 459 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/satellite.Po@am__quote@ 458 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_animation.Po@am__quote@459 460 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skybox.Po@am__quote@ 460 461 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@ -
orxonox/trunk/src/animation.h
r3849 r3851 49 49 virtual void rewind() = 0; 50 50 51 virtual void tick(float time ) = 0;51 virtual void tick(float timePassed) = 0; 52 52 53 53 /* implement in subclasses: … … 64 64 \returns the BaseObject, this animation operates on 65 65 */ 66 BaseObject* getBaseObject(void) const { 66 BaseObject* getBaseObject(void) const {return baseObject;} 67 67 68 68 protected: -
orxonox/trunk/src/simple_animation.cc
r3850 r3851 1 1 2 3 4 /* 2 /* 5 3 orxonox - the future of 3D-vertical-scrollers 6 4 … … 14 12 ### File Specific: 15 13 main-programmer: Patrick Boenzli 16 co-programmer: ... 14 co-programmer: Benjamin Grauer 15 16 2005-04-17: Benjamin Grauer 17 Rewritte all functions, so it will fit into the Animation-class 17 18 */ 18 19 19 20 20 21 #include "simple_animation.h" 21 #include "stdincl.h"22 #include "vector.h"23 #include "world_entity.h"24 25 using namespace std;26 27 28 Animation3D::Animation3D(void)29 {30 31 }32 33 Animation3D::~Animation3D(void)34 {35 36 }37 38 39 void Animation3D::rewind(void)40 {41 42 }43 44 void Animation3D::setAnimFunc(ANIM_FUNCTION animFunc)45 {46 switch (animFunc)47 {48 default:49 case ANIM_CONSTANT:50 this->animFunc = &Animation3D::constant;51 break;52 case ANIM_LINEAR:53 this->animFunc = &Animation3D::linear;54 break;55 case ANIM_SINE:56 this->animFunc = &Animation3D::sine;57 break;58 case ANIM_COSINE:59 this->animFunc = &Animation3D::cosine;60 break;61 case ANIM_EXP:62 this->animFunc = &Animation3D::exp;63 break;64 case ANIM_NEG_EXP:65 this->animFunc = &Animation3D::negExp;66 break;67 case ANIM_QUADRATIC:68 this->animFunc = &Animation3D::quadratic;69 break;70 case ANIM_RANDOM:71 this->animFunc = &Animation3D::random;72 break;73 }74 }75 76 77 void Animation3D::tick(float timePassed)78 {79 80 }81 82 83 float Animation3D::constant(float timePassed) const84 {85 86 }87 88 float Animation3D::linear(float timePassed) const89 {90 91 }92 93 float Animation3D::sine(float timePassed) const94 {95 96 }97 98 float Animation3D::cosine(float timePassed) const99 {100 101 }102 103 float Animation3D::exp(float timePassed) const104 {105 106 }107 108 float Animation3D::negExp(float timePassed) const109 {110 111 }112 113 float Animation3D::quadratic(float timePassed) const114 {115 116 }117 118 float Animation3D::random(float timePassed) const119 {120 121 }122 123 124 125 126 22 127 23 … … 216 112 \param object wo work on 217 113 */ 218 void SimpleAnimation::selectObject( WorldEntity* entity)219 { 220 Animation3D* anim = getAnimationFrom WorldEntity(entity);114 void SimpleAnimation::selectObject(PNode* entity) 115 { 116 Animation3D* anim = getAnimationFromPNode(entity); 221 117 if( anim == NULL) 222 118 { … … 482 378 483 379 484 Animation3D* SimpleAnimation::getAnimationFrom WorldEntity(WorldEntity* entity)380 Animation3D* SimpleAnimation::getAnimationFromPNode(PNode* entity) 485 381 { 486 382 tIterator<Animation3D>* iterator = this->animators->getIterator(); -
orxonox/trunk/src/simple_animation.h
r3850 r3851 18 18 class Vector; 19 19 class Quaternion; 20 class WorldEntity;21 20 class PNode; 22 21 … … 33 32 Vector* position; 34 33 Quaternion* direction; 35 WorldEntity* object;34 PNode* object; 36 35 float time; 37 36 movementMode mode; … … 58 57 void setAnimFunc(ANIM_FUNCTION animFunc); 59 58 59 private: 60 60 float constant(float timePassed) const; 61 61 float linear(float timePassed) const; … … 73 73 74 74 // private 75 WorldEntity* object;75 PNode* object; 76 76 Vector* lastPosition; 77 77 Vector* tmpVect; … … 100 100 void animatorBegin(); 101 101 void animatorEnd(); 102 void selectObject( WorldEntity* entity);102 void selectObject(PNode* entity); 103 103 void addKeyFrame(Vector* point, Quaternion* direction, float time); 104 104 void addKeyFrame(Vector* point, Quaternion* direction, float time, movementMode mode); … … 132 132 133 133 Vector* tmpVect; //<! this is the temporary vector save place - 134 WorldEntity* workingObject; //<! this is a pointer to the current working object that has been selected via selectObject()134 PNode* workingObject; //<! this is a pointer to the current working object that has been selected via selectObject() 135 135 Animation3D* workingAnimator; //<! the animator with which you are currently working 136 136 float deltaT; //<! this is a time constant for the movement 137 137 138 Animation3D* getAnimationFrom WorldEntity(WorldEntity* entity);138 Animation3D* getAnimationFromPNode(PNode* entity); 139 139 140 140 }; -
orxonox/trunk/src/story_entities/world.cc
r3848 r3851 38 38 #include "track_manager.h" 39 39 #include "garbage_collector.h" 40 #include "simple_animation.h"41 40 #include "animation_player.h" 42 41 … … 161 160 TextEngine::getInstance()->flush(); 162 161 163 delete this->simpleAnimation;164 165 162 AnimationPlayer::getInstance()->debug(); 166 163 delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence. … … 203 200 wi->init(this); 204 201 this->garbageCollector = GarbageCollector::getInstance(); 205 this->simpleAnimation = SimpleAnimation::getInstance();206 202 } 207 203 … … 935 931 this->localCamera->tick(this->dt); 936 932 this->garbageCollector->tick(seconds); 937 this->simpleAnimation->tick(seconds); 933 938 934 AnimationPlayer::getInstance()->tick(seconds); 939 935 } -
orxonox/trunk/src/story_entities/world.h
r3847 r3851 24 24 class Terrain; 25 25 class GarbageCollector; 26 class SimpleAnimation;27 26 class Text; 28 27 … … 116 115 GarbageCollector* garbageCollector; //!< reference to the garbage collector 117 116 118 SimpleAnimation* simpleAnimation; //!< reference to the SimpleAnimation object119 120 117 /* function for main-loop */ 121 118 void mainLoop (); -
orxonox/trunk/src/t_animation.h
r3849 r3851 1 2 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific: 12 main-programmer: Benjamin Grauer 13 co-programmer: ... 14 */ 15 16 17 /*! 18 \file t_animation.h 19 */ 20 21 #ifndef _T_ANIMATION_H 22 #define _T_ANIMATION_H 3 23 4 24 #include "animation.h" … … 16 36 void addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc = ANIM_LINEAR); 17 37 18 virtual void tick(float time );38 virtual void tick(float timePassed); 19 39 20 40 // animation functions 21 41 void setAnimFunc(ANIM_FUNCTION animFunc); 42 43 private: 22 44 23 45 float constant(float timePassed) const; … … 29 51 float quadratic(float timePassed) const; 30 52 float random(float timePassed) const; 53 54 31 55 // ANIM_FUNCTION animFunc; 32 56 float (tAnimation<T>::*animFunc)(float) const; … … 35 59 tList<KeyFrameF>* keyFrameList; 36 60 37 38 39 40 private:41 61 float expFactor; 42 62 T* object; … … 110 130 if (duration <= 0.0) 111 131 duration = 1.0; 112 113 132 114 133 KeyFrameF* tmpKeyFrame; … … 135 154 136 155 template<class T> 137 void tAnimation<T>::tick(float time )156 void tAnimation<T>::tick(float timePassed) 138 157 { 139 158 if (this->bRunning) 140 159 { 141 this->localTime += time ;160 this->localTime += timePassed; 142 161 if (localTime >= this->currentKeyFrame->duration) 143 162 { 144 163 // switching to the next Key-Frame 164 this->localTime -= this->currentKeyFrame->duration; 165 145 166 this->currentKeyFrame = this->nextKeyFrame; 146 this->localTime = 0;147 167 // checking, if we should still Play the animation 148 168 if (this->currentKeyFrame == this->keyFrameList->lastElement()) … … 270 290 271 291 } 292 293 294 #endif /* _T_ANIMATION_H */ -
orxonox/trunk/src/world_entities/test_gun.cc
r3847 r3851 30 30 #include "vector.h" 31 31 #include "list.h" 32 #include " simple_animation.h"32 #include "animation3d.h" 33 33 34 34 using namespace std; … … 53 53 54 54 55 this->animato r = SimpleAnimation::getInstance();55 this->animaton = new Animation3D; 56 56 this->dummy1 = new WorldEntity(); // a world entity that is not drawed: use this for the weapon 57 57 /* -
orxonox/trunk/src/world_entities/test_gun.h
r3757 r3851 29 29 class Vector; 30 30 class Quaternion; 31 class SimpleAnimation;31 class Animation3D; 32 32 33 33 … … 52 52 53 53 private: 54 SimpleAnimation* animator;54 Animation3D* animaton; 55 55 Vector* projOffset; 56 56 WorldEntity* dummy1;
Note: See TracChangeset
for help on using the changeset viewer.