Changeset 4485 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 3, 2005, 12:19:43 AM (19 years ago)
- Location:
- orxonox/trunk/src/util
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/animation/animation.h
r4381 r4485 80 80 //! A virtual function that should change to the first keyframe. 81 81 virtual void rewind() = 0; 82 82 83 /** \brief A virtual function that ticks the animation \param dt the time passed */ 83 84 virtual void tick(float dt) = 0; 84 85 85 /** 86 \returns the BaseObject, this animation operates on 87 */ 88 BaseObject* getBaseObject(void) const {return baseObject;} 86 /** \returns the BaseObject, this animation operates on */ 87 BaseObject* getBaseObject(void) const { return this->baseObject; }; 89 88 90 89 /** \returns if the Animation should be deleted */ 91 inline bool ifDelete(void) { return bDelete;}90 inline bool ifDelete(void) { return bDelete; }; 92 91 93 92 protected: … … 95 94 96 95 void handleInfinity(void); 96 97 protected: 97 98 // variables 98 float localTime;//!< The Time passed since the beginning of the currentKeyFrame.99 ANIM_INFINITY postInfinity;//!< describing what the animation should do after the last keyframe.99 float localTime; //!< The Time passed since the beginning of the currentKeyFrame. 100 ANIM_INFINITY postInfinity; //!< describing what the animation should do after the last keyframe. 100 101 101 BaseObject* baseObject;//!< The same as object in the derived classes, but with reference to BaseObject102 unsigned int keyFrameCount;//!< The Count of KeyFrames.103 int keyFramesToPlay;//!< How many more Keyframes to play. if negative it will be ignored if 0 stop.104 bool bHandled;//!< If this Animation is handled by the AnimationPlayer.105 bool bRunning;//!< If the animation is running106 bool bDelete;//!< If true, the animation will be deleted through the AnimationPlayer.102 BaseObject* baseObject; //!< The same as object in the derived classes, but with reference to BaseObject 103 unsigned int keyFrameCount; //!< The Count of KeyFrames. 104 int keyFramesToPlay; //!< How many more Keyframes to play. if negative it will be ignored if 0 stop. 105 bool bHandled; //!< If this Animation is handled by the AnimationPlayer. 106 bool bRunning; //!< If the animation is running 107 bool bDelete; //!< If true, the animation will be deleted through the AnimationPlayer. 107 108 }; 108 109 109 110 111 112 110 113 /**********************TEST*******************************/ 114 //! a simple testClass for the animation 111 115 class aTest 112 116 { 113 117 public: 114 aTest() { last = 0.0;}115 ~aTest() {}116 void littleDebug(float f) { diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}118 inline aTest() { last = 0.0;} 119 /** \brief a little debug information to show the results of this class \param f new value */ 120 inline void littleDebug(float f) { diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;} 117 121 private: 118 float diff;119 float last;122 float diff; //!< difference from the last value 123 float last; //!< the last calculated value 120 124 }; 121 125 -
orxonox/trunk/src/util/animation/animation3d.cc
r4000 r4485 86 86 \param duration The duration from the new KeyFrame to the next one 87 87 \param animFuncMov The function to animate position between this keyFrame and the next one 88 \param animFuncMov The function to animate rotation between this keyFrame and the next one 89 */ 90 void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration, ANIM_FUNCTION animFuncMov, ANIM_FUNCTION animFuncRot) 88 \param animFuncRot The function to animate rotation between this keyFrame and the next one 89 */ 90 void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration, 91 ANIM_FUNCTION animFuncMov, ANIM_FUNCTION animFuncRot) 91 92 { 92 93 // some small check … … 167 168 /** 168 169 \brief Sets The kind of movment Animation between this keyframe and the next one 169 \param animFunc The Type of Animation to set170 \param animFuncMov: The Type of Animation to set 170 171 */ 171 172 void Animation3D::setAnimFuncMov(ANIM_FUNCTION animFuncMov) … … 213 214 } 214 215 } 215 216 217 216 218 217 /** … … 348 347 /** 349 348 \brief Sets The kind of rotation Animation between this keyframe and the next one 350 \param animFunc The Type of Animation to set349 \param animFuncRot: The Type of Animation to set 351 350 */ 352 351 void Animation3D::setAnimFuncRot(ANIM_FUNCTION animFuncRot) -
orxonox/trunk/src/util/animation/animation3d.h
r3981 r4485 16 16 */ 17 17 typedef struct KeyFrame3D { 18 float duration;//!< The duration of this KeyFrame19 Vector position;//!< The position of this KeyFrame20 Vector lastPosition;21 Quaternion direction; //!< The direction of this KeyFrame22 ANIM_FUNCTION animFuncMov;//!< with whitch function to iterate movement to the next KeyFrame3D23 ANIM_FUNCTION animFuncRot;//!< with whitch function to iterate rotation to the next KeyFrame3D18 float duration; //!< The duration of this KeyFrame 19 Vector position; //!< The position of this KeyFrame 20 Vector lastPosition; //!< The last known position 21 Quaternion direction; //!< The direction of this KeyFrame 22 ANIM_FUNCTION animFuncMov; //!< with whitch function to iterate movement to the next KeyFrame3D 23 ANIM_FUNCTION animFuncRot; //!< with whitch function to iterate rotation to the next KeyFrame3D 24 24 }; 25 25 26 //! Animation Struct26 //! Animation Class for 3D-transformations (movement and rotation) 27 27 /** 28 28 This represents an animation for a object … … 65 65 void (Animation3D::*animFuncRot)(float) const; //!< A Function for the AnimationType 66 66 67 KeyFrame3D* currentKeyFrame; //!< The current KeyFrame 68 KeyFrame3D* nextKeyFrame; //!< The KeyFrame we iterate to 69 tList<KeyFrame3D>* keyFrameList; //!< The KeyFrameList 67 68 private: 69 KeyFrame3D* currentKeyFrame; //!< The current KeyFrame 70 KeyFrame3D* nextKeyFrame; //!< The KeyFrame we iterate to 71 tList<KeyFrame3D>* keyFrameList; //!< The KeyFrameList 72 70 73 71 74 // more class-local description 72 PNode* object;//!< The Object from which to Animate something73 Vector lastPosition; //!< ??74 Vector tmpVect; //!< what for??75 float deltaT; //!< ??76 float expFactorMov;77 float expFactorRot;75 PNode* object; //!< The Object from which to Animate something 76 Vector lastPosition; //!< last Object 77 Vector tmpVect; //!< temporary vector 78 float deltaT; //!< time passed since last 79 float expFactorMov; //!< exponential Factor for movement 80 float expFactorRot; //!< exponential Factor for rotation 78 81 }; -
orxonox/trunk/src/util/animation/animation_player.cc
r4320 r4485 38 38 */ 39 39 AnimationPlayer* AnimationPlayer::singletonRef = NULL; 40 41 /**42 \returns a Pointer to this Class43 */44 AnimationPlayer* AnimationPlayer::getInstance(void)45 {46 if (!AnimationPlayer::singletonRef)47 AnimationPlayer::singletonRef = new AnimationPlayer();48 return AnimationPlayer::singletonRef;49 }50 40 51 41 /** … … 148 138 } 149 139 150 151 Animation* AnimationPlayer::getObjectFromBaseObject(const BaseObject* baseObject) const 140 /** 141 \returns the animation from a certain baseobject 142 if multiple are found, it just retruns the first one 143 if none is found it returns NULL 144 */ 145 Animation* AnimationPlayer::getAnimationFromBaseObject(const BaseObject* baseObject) const 152 146 { 153 147 tIterator<Animation>* animIt = this->animationList->getIterator(); … … 163 157 } 164 158 delete animIt; 165 159 return NULL; 166 160 } 167 161 -
orxonox/trunk/src/util/animation/animation_player.h
r3868 r4485 29 29 30 30 public: 31 static AnimationPlayer* getInstance(void); 31 /** \returns a Pointer to the only object of this Class */ 32 inline static AnimationPlayer* getInstance(void) { if (!singletonRef) singletonRef = new AnimationPlayer(); return singletonRef; }; 33 32 34 virtual ~AnimationPlayer(void); 33 35 … … 42 44 void pause(void); 43 45 44 Animation* get ObjectFromBaseObject(const BaseObject* baseObject) const;46 Animation* getAnimationFromBaseObject(const BaseObject* baseObject) const; 45 47 46 48 void debug(void); … … 49 51 /* singleton */ 50 52 AnimationPlayer(void); 51 static AnimationPlayer* singletonRef;53 static AnimationPlayer* singletonRef; //!< SingletonReference to this class. 52 54 53 55 /* class specific */ 54 tList<Animation>* animationList; //!< A List of Animations to be handled.55 bool bRunning;//!< If the AnimationPlayer is running.56 tList<Animation>* animationList; //!< A List of Animations to be handled. 57 bool bRunning; //!< If the AnimationPlayer is running. 56 58 }; 57 59 -
orxonox/trunk/src/util/garbage_collector.cc
r4389 r4485 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 34 32 /** 35 33 \brief standard constructor 36 \todo this constructor is not jet implemented - do it37 34 */ 38 35 GarbageCollector::GarbageCollector () … … 46 43 /** 47 44 \brief standard deconstructor 48 49 45 */ 50 46 GarbageCollector::~GarbageCollector () … … 68 64 /** 69 65 \brief this sets the collection delay 70 \param delay 66 \param delay: the delay 71 67 72 68 after this delay, the garbage collector starts its work and begins to collect unused object … … 97 93 /** 98 94 \brief this ticks the GarbageCollector to give it the time pulse 99 \param t he time passed since last tick95 \param time: the time passed since last tick 100 96 101 97 like every other tick function eg. worldentity … … 109 105 /** 110 106 \brief this updated the gargabe collection, if the time is ready 111 112 113 107 */ 114 108 void GarbageCollector::update() -
orxonox/trunk/src/util/garbage_collector.h
r4262 r4485 1 1 /*! 2 \file proto_class.h2 \file garbage_collector.h 3 3 \brief Definition of the proto class template, used quickly start work 4 4 \todo Example: this shows how to use simply add a Marker that here has to be done something. … … 34 34 35 35 private: 36 static GarbageCollector* singletonRef;37 float delay;//!< this is the delay to wait until collection38 float time;//!< the current time36 static GarbageCollector* singletonRef; //!< The reference to this class (singleton) 37 float delay; //!< this is the delay to wait until collection 38 float time; //!< the current time 39 39 40 40 }; -
orxonox/trunk/src/util/object_manager.cc
r4324 r4485 58 58 /** 59 59 \brief standard deconstructor 60 61 60 */ 62 61 ObjectManager::~ObjectManager () … … 65 64 } 66 65 67 66 /** 67 \brief adds an element to the list of dead objects 68 \param index: The type of object to add 69 \param object: pointer to the object at hand 70 */ 68 71 void ObjectManager::addToDeadList(int index, BaseObject* object) 69 72 { … … 74 77 } 75 78 79 /** 80 \brief resurects an object 81 \param index: the type of resource to load 82 \param number: how many of them 76 83 84 \todo if it is unable to get an object from the deadList, it should create it 85 */ 77 86 BaseObject* ObjectManager::getFromDeadList(int index, int number) 78 87 { … … 92 101 } 93 102 94 95 void ObjectManager::debug() 103 /** 104 \brief outputs some simple debug information about the ObjectManage 105 */ 106 void ObjectManager::debug(void) const 96 107 { 97 108 PRINT(0)("\n==========================| ObjectManager::debug() |===\n"); -
orxonox/trunk/src/util/object_manager.h
r4322 r4485 31 31 32 32 33 //! This defines the "template" ma kro function for cache(...)33 //! This defines the "template" macro function for cache(...) 34 34 #define mCache( Class ) \ 35 35 cache(classList index, int number, Class * copyObject) \ … … 51 51 virtual ~ObjectManager(void); 52 52 53 /** a class handled by the objectManage */ 53 54 void mCache(Projectile); 54 55 void addToDeadList(int index, BaseObject* object); 55 56 BaseObject* getFromDeadList(int index, int number = 1); 56 57 57 void debug( );58 void debug(void) const; 58 59 59 60 private: 60 61 ObjectManager(void); 61 62 62 static ObjectManager* singletonRef; 63 private: 64 static ObjectManager* singletonRef; //!< The singleton reference to the only reference of this class 63 65 64 tList<BaseObject>** managedObjectList;65 GarbageCollector* garbageCollector;66 tList<BaseObject>** managedObjectList; //!< A list of managed objects (handles different types and lists of them) 67 GarbageCollector* garbageCollector; //!< reference to the GrabageCollector 66 68 }; 67 69 -
orxonox/trunk/src/util/state.cc
r4381 r4485 42 42 43 43 /** 44 \returns a Pointer to this Class45 */46 State* State::getInstance(void)47 {48 if (!State::singletonRef)49 State::singletonRef = new State();50 return State::singletonRef;51 }52 53 /**54 44 \brief standard deconstructor 55 56 45 */ 57 46 State::~State () … … 62 51 63 52 /** 64 \ sets camera and target of the current Camera53 \brief sets camera and target of the current Camera 65 54 */ 66 55 void State::setCamera(const PNode* camera, const PNode* cameraTarget) -
orxonox/trunk/src/util/state.h
r4338 r4485 1 1 /*! 2 \file proto_singleton.h2 \file state.h 3 3 \brief Definition of the States-singleton Class 4 5 4 */ 6 5 … … 17 16 18 17 public: 19 static State* getInstance(void); 18 /** \returns a Pointer to the only object of this Class */ 19 inline static State* getInstance(void) { if (!singletonRef) singletonRef = new State(); return singletonRef; }; 20 20 21 virtual ~State(void); 21 22 22 23 void setCamera(const PNode* camera, const PNode* cameraTarget); 24 /** \returns a Pointer to the PNode of the Camera */ 23 25 const PNode* getCamera(void) const { return this->camera; }; 26 /** \returns a Pointer to the CameraTarget */ 24 27 const PNode* getCameraTarget(void) const { return this->cameraTarget; }; 25 28 26 29 private: 27 30 State(void); 28 static State* singletonRef;31 static State* singletonRef; //!< a reference to this class 29 32 30 const PNode* camera;31 const PNode* cameraTarget;33 const PNode* camera; //!< A reference to the camera 34 const PNode* cameraTarget; //!< a reference to the cameraTarget 32 35 }; 33 36
Note: See TracChangeset
for help on using the changeset viewer.