Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3854 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Apr 17, 2005, 2:12:23 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: doxy-tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/t_animation.h

    r3853 r3854  
    1313   co-programmer: ...
    1414*/
    15 
    1615
    1716/*!
     
    5453
    5554  //  ANIM_FUNCTION animFunc;
    56   float (tAnimation<T>::*animFunc)(float) const;
    57   KeyFrameF* currentKeyFrame;
    58   KeyFrameF* nextKeyFrame;
    59   tList<KeyFrameF>* keyFrameList;
    60 
    61   float expFactor;
    62   T* object;
    63   void (T::*funcToAnim)(float);
     55  float (tAnimation<T>::*animFunc)(float) const;  //!< A Function for the AnimationType
     56  KeyFrameF* currentKeyFrame;                     //!< The current KeyFrame
     57  KeyFrameF* nextKeyFrame;                        //!< The KeyFrame we iterate to
     58  tList<KeyFrameF>* keyFrameList;                 //!< The KeyFrameList
     59
     60  T* object;                                      //!< The Object from which to Animate something
     61  void (T::*funcToAnim)(float);                   //!< The function to Animate
     62
     63  float expFactor;                                //!< some factors
     64
    6465};
    6566
     
    6869/**
    6970   \brief standard constructor
    70 
    7171*/
    7272template<class T>
     
    9191/**
    9292   \brief standard deconstructor
    93 
     93   
     94   deletes all the Keyframes
    9495*/
    9596template<class T>
     
    106107  delete itKF;
    107108  delete this->keyFrameList;
    108 
    109 }
    110 
     109}
     110
     111/**
     112   \brief rewinds the Animation to the beginning (first KeyFrame and time == 0)
     113*/
    111114template<class T>
    112115void tAnimation<T>::rewind(void)
     
    117120}
    118121
     122/**
     123   \brief sets the Function we want to animate
     124   \param object from what object do we want to animate
     125   \param funcToAnim which function
     126*/
    119127template<class T>
    120128void tAnimation<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float))
     
    124132}
    125133
     134/**
     135   \brief Appends a new Keyframe
     136   \param value the value of the new KeyFrame
     137   \param duration The duration from the new KeyFrame to the next one
     138   \param animFunc The function to animate between this keyFrame and the next one
     139*/
    126140template<class T>
    127141void tAnimation<T>::addKeyFrame(float value, float duration, ANIM_FUNCTION animFunc)
     
    152166}
    153167
    154 
     168/**
     169   \brief ticks the Animation
     170   \param dt how much time to tick
     171*/
    155172template<class T>
    156173void tAnimation<T>::tick(float dt)
     
    187204}
    188205
    189 
     206/**
     207   \brief Sets The kind of Animation between this keyframe and the next one
     208   \param animFunc The Type of Animation to set
     209*/
    190210template<class T>
    191211void tAnimation<T>::setAnimFunc(ANIM_FUNCTION animFunc)
     
    227247
    228248// animation functions
     249
     250/**
     251   \brief some random animation (fluctuating)
     252   \param timePassed The time passed since this Keyframe began
     253*/
    229254template<class T>
    230255float tAnimation<T>::random(float timePassed) const
    231256{
    232   return (float)rand()/(float)RAND_MAX;
    233 }
    234 
     257  return this->currentKeyFrame->value * (float)rand()/(float)RAND_MAX;
     258}
     259
     260/**
     261   \brief stays at the value of the currentKeyFrame
     262   \param timePassed The time passed since this Keyframe began
     263*/
    235264template<class T>
    236265float tAnimation<T>::constant(float timePassed) const
     
    239268}
    240269
     270/**
     271   \brief linear interpolation between this keyframe and the next one
     272   \param timePassed The time passed since this Keyframe began
     273*/
    241274template<class T>
    242275float tAnimation<T>::linear(float timePassed) const
     
    248281}
    249282
     283/**
     284   \brief a Sinusodial Interpolation between this keyframe and the next one
     285   \param timePassed The time passed since this Keyframe began
     286*/
    250287template<class T>
    251288float tAnimation<T>::sine(float timePassed) const
     
    260297}
    261298
     299/**
     300   \brief a cosine interpolation between this keyframe and the next one
     301   \param timePassed The time passed since this Keyframe began
     302*/
    262303template<class T>
    263304float tAnimation<T>::cosine(float timePassed) const
     
    273314}
    274315
     316/**
     317   \brief an exponential interpolation between this keyframe and the next one
     318   \param timePassed The time passed since this Keyframe began
     319*/
    275320template<class T>
    276321float tAnimation<T>::exp(float timePassed) const
     
    278323}
    279324
     325/**
     326   \brief a negative exponential interpolation between this keyframe and the next one
     327   \param timePassed The time passed since this Keyframe began
     328*/
    280329template<class T>
    281330float tAnimation<T>::negExp(float timePassed) const
     
    286335}
    287336
     337/**
     338   \brief a quadratic interpolation between this keyframe and the next one
     339   \param timePassed The time passed since this Keyframe began
     340*/
    288341template<class T>
    289342float tAnimation<T>::quadratic(float timePassed) const
Note: See TracChangeset for help on using the changeset viewer.