Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4485 in orxonox.OLD


Ignore:
Timestamp:
Jun 3, 2005, 12:19:43 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more documentation in util

Location:
orxonox/trunk/src/util
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/animation/animation.h

    r4381 r4485  
    8080  //! A virtual function that should change to the first keyframe.
    8181  virtual void rewind() = 0;
     82
    8283  /** \brief A virtual function that ticks the animation \param dt the time passed */
    8384  virtual void tick(float dt) = 0;
    8485
    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; };
    8988
    9089  /** \returns if the Animation should be deleted */
    91   inline bool ifDelete(void) {return bDelete;}
     90  inline bool ifDelete(void) { return bDelete; };
    9291
    9392 protected:
     
    9594
    9695  void handleInfinity(void);
     96
     97 protected:
    9798  // 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.
    100101
    101   BaseObject* baseObject;         //!< The same as object in the derived classes, but with reference to BaseObject
    102   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 running
    106   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.
    107108};
    108109
    109110
     111
     112
    110113/**********************TEST*******************************/
     114//! a simple testClass for the animation
    111115class aTest
    112116{
    113117 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;}
    117121 private:
    118   float diff;
    119   float last;
     122  float     diff;           //!< difference from the last value
     123  float     last;           //!< the last calculated value
    120124};
    121125
  • orxonox/trunk/src/util/animation/animation3d.cc

    r4000 r4485  
    8686   \param duration The duration from the new KeyFrame to the next one
    8787   \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*/
     90void Animation3D::addKeyFrame(Vector position, Quaternion direction, float duration,
     91                              ANIM_FUNCTION animFuncMov, ANIM_FUNCTION animFuncRot)
    9192{
    9293  // some small check
     
    167168/**
    168169   \brief Sets The kind of movment Animation between this keyframe and the next one
    169    \param animFunc The Type of Animation to set
     170   \param animFuncMov: The Type of Animation to set
    170171*/
    171172void Animation3D::setAnimFuncMov(ANIM_FUNCTION animFuncMov)
     
    213214    }
    214215}
    215 
    216 
    217216
    218217/**
     
    348347/**
    349348   \brief Sets The kind of rotation Animation between this keyframe and the next one
    350    \param animFunc The Type of Animation to set
     349   \param animFuncRot: The Type of Animation to set
    351350*/
    352351void Animation3D::setAnimFuncRot(ANIM_FUNCTION animFuncRot)
  • orxonox/trunk/src/util/animation/animation3d.h

    r3981 r4485  
    1616*/
    1717typedef struct KeyFrame3D {
    18   float duration;                   //!< The duration of this KeyFrame
    19   Vector position;                  //!< The position of this KeyFrame
    20   Vector lastPosition;
    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
     18  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
    2424};
    2525
    26 //! Animation Struct
     26//! Animation Class for 3D-transformations (movement and rotation)
    2727/**
    2828   This represents an animation for a object
     
    6565  void (Animation3D::*animFuncRot)(float) const;      //!< A Function for the AnimationType
    6666
    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
    7073
    7174  // more class-local description
    72   PNode* object;                                   //!< The Object from which to Animate something
    73   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
    7881};
  • orxonox/trunk/src/util/animation/animation_player.cc

    r4320 r4485  
    3838*/
    3939AnimationPlayer* AnimationPlayer::singletonRef = NULL;
    40 
    41 /**
    42    \returns a Pointer to this Class
    43 */
    44 AnimationPlayer* AnimationPlayer::getInstance(void)
    45 {
    46   if (!AnimationPlayer::singletonRef)
    47     AnimationPlayer::singletonRef = new AnimationPlayer();
    48   return AnimationPlayer::singletonRef;
    49 }
    5040
    5141/**
     
    148138}
    149139
    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*/
     145Animation* AnimationPlayer::getAnimationFromBaseObject(const BaseObject* baseObject) const
    152146{
    153147  tIterator<Animation>* animIt = this->animationList->getIterator();
     
    163157    }
    164158  delete animIt;
    165 
     159  return NULL;
    166160}
    167161
  • orxonox/trunk/src/util/animation/animation_player.h

    r3868 r4485  
    2929
    3030 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
    3234  virtual ~AnimationPlayer(void);
    3335
     
    4244  void pause(void);
    4345
    44   Animation* getObjectFromBaseObject(const BaseObject* baseObject) const;
     46  Animation* getAnimationFromBaseObject(const BaseObject* baseObject) const;
    4547
    4648  void debug(void);
     
    4951  /* singleton */
    5052  AnimationPlayer(void);
    51   static AnimationPlayer* singletonRef;
     53  static AnimationPlayer*      singletonRef;          //!< SingletonReference to this class.
    5254
    5355  /* 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.
    5658};
    5759
  • orxonox/trunk/src/util/garbage_collector.cc

    r4389 r4485  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    3432/**
    3533   \brief standard constructor
    36    \todo this constructor is not jet implemented - do it
    3734*/
    3835GarbageCollector::GarbageCollector ()
     
    4643/**
    4744   \brief standard deconstructor
    48 
    4945*/
    5046GarbageCollector::~GarbageCollector ()
     
    6864/**
    6965   \brief this sets the collection delay
    70    \param delay
     66   \param delay: the delay
    7167   
    7268   after this delay, the garbage collector starts its work and begins to collect unused object
     
    9793/**
    9894   \brief this ticks the GarbageCollector to give it the time pulse
    99    \param the time passed since last tick
     95   \param time: the time passed since last tick
    10096
    10197   like every other tick function eg. worldentity
     
    109105/**
    110106   \brief this updated the gargabe collection, if the time is ready
    111 
    112 
    113107*/
    114108void GarbageCollector::update()
  • orxonox/trunk/src/util/garbage_collector.h

    r4262 r4485  
    11/*!
    2     \file proto_class.h
     2    \file garbage_collector.h
    33    \brief Definition of the proto class template, used quickly start work
    44    \todo Example: this shows how to use simply add a Marker that here has to be done something.
     
    3434
    3535 private:
    36   static GarbageCollector* singletonRef;
    37   float delay;                                        //!< this is the delay to wait until collection
    38   float time;                                         //!< the current time
     36  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
    3939
    4040};
  • orxonox/trunk/src/util/object_manager.cc

    r4324 r4485  
    5858/**
    5959   \brief standard deconstructor
    60 
    6160*/
    6261ObjectManager::~ObjectManager ()
     
    6564}
    6665
    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*/
    6871void ObjectManager::addToDeadList(int index, BaseObject* object)
    6972{
     
    7477}
    7578
     79/**
     80   \brief resurects an object
     81   \param index: the type of resource to load
     82   \param number: how many of them
    7683
     84   \todo if it is unable to get an object from the deadList, it should create it
     85*/
    7786BaseObject* ObjectManager::getFromDeadList(int index, int number)
    7887{
     
    92101}
    93102
    94 
    95 void ObjectManager::debug()
     103/**
     104   \brief outputs some simple debug information about the ObjectManage
     105*/
     106void ObjectManager::debug(void) const
    96107{
    97108  PRINT(0)("\n==========================| ObjectManager::debug() |===\n");
  • orxonox/trunk/src/util/object_manager.h

    r4322 r4485  
    3131
    3232
    33 //! This defines the "template" makro function for cache(...)
     33//! This defines the "template" macro function for cache(...)
    3434#define mCache( Class ) \
    3535 cache(classList index, int number, Class * copyObject)        \
     
    5151  virtual ~ObjectManager(void);
    5252 
     53  /** a class handled by the objectManage */
    5354  void mCache(Projectile);
    5455  void addToDeadList(int index, BaseObject* object);
    5556  BaseObject* getFromDeadList(int index, int number = 1);
    5657
    57   void debug();
     58  void debug(void) const;
    5859
    5960 private:
    6061  ObjectManager(void);
    6162
    62   static ObjectManager* singletonRef;
     63 private:
     64  static ObjectManager*      singletonRef;          //!< The singleton reference to the only reference of this class
    6365
    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
    6668};
    6769
  • orxonox/trunk/src/util/state.cc

    r4381 r4485  
    4242
    4343/**
    44    \returns a Pointer to this Class
    45 */
    46 State* State::getInstance(void)
    47 {
    48   if (!State::singletonRef)
    49     State::singletonRef = new State();
    50   return State::singletonRef;
    51 }
    52 
    53 /**
    5444   \brief standard deconstructor
    55 
    5645*/
    5746State::~State ()
     
    6251
    6352/**
    64    \sets camera and target of the current Camera
     53   \brief sets camera and target of the current Camera
    6554*/
    6655void State::setCamera(const PNode* camera, const PNode* cameraTarget)
  • orxonox/trunk/src/util/state.h

    r4338 r4485  
    11/*!
    2     \file proto_singleton.h
     2    \file state.h
    33    \brief Definition of the States-singleton Class
    4    
    54*/
    65
     
    1716
    1817 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
    2021  virtual ~State(void);
    2122
    2223  void setCamera(const PNode* camera, const PNode* cameraTarget);
     24  /** \returns a Pointer to the PNode of the Camera */
    2325  const PNode* getCamera(void) const { return this->camera; };
     26  /** \returns a Pointer to the CameraTarget */
    2427  const PNode* getCameraTarget(void) const { return this->cameraTarget; };
    2528
    2629 private:
    2730  State(void);
    28   static State* singletonRef;
     31  static State*       singletonRef;       //!< a reference to this class
    2932
    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
    3235};
    3336
Note: See TracChangeset for help on using the changeset viewer.