Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3833 in orxonox.OLD for orxonox/trunk/src/animation.h


Ignore:
Timestamp:
Apr 14, 2005, 2:03:05 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: animation can now return the BaseObject it operates on

File:
1 edited

Legend:

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

    r3832 r3833  
    2828
    2929#include "list.h"
     30#include "base_object.h"
     31
    3032// FORWARD DEFINITION
    3133
     
    5254  ANIM_FUNCTION animFunc;
    5355};
    54 
    55 
    56 /**********************TEST*******************************/
    57 class aTest
    58 {
    59  public:
    60   aTest() { last = 0.0;}
    61   ~aTest() {}
    62   void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
    63  private:
    64   float diff;
    65   float last;
    66 };
    67 
    68 //aTest::aTest() {}
    69 //aTest::~aTest() {}
    70 
    71 //void aTest::littleDebug(float f)
    72 
    73 /**********************TEST*******************************/
    74 
    7556
    7657class Anim
     
    9980   * virtual rewind, to go to the first Keyframe. (other functions will call this one)
    10081   */
     82
     83  /**
     84     \returns the BaseObject, this animation operates on
     85  */
     86  BaseObject* getBaseObject(void) const { return baseObject;}
     87
    10188 protected:
    10289  Anim(void);
     
    10794  ANIM_INFINITY postInfinity;
    10895
     96  BaseObject* baseObject;         //!< The same as object in the derived classes, but with reference to BaseObject
    10997  bool bHasKeys;
    11098  bool bHandled;                  //!< If this Animation is handled by the AnimationPlayer.
     
    209197void tAnim<T>::setFuncToAnim(T* object, void (T::*funcToAnim)(float))
    210198{
    211   this->object = object;
     199  this->baseObject = this->object = object;
    212200  this->funcToAnim = funcToAnim;
    213201}
     
    380368
    381369
     370
     371/**********************TEST*******************************/
     372class aTest
     373{
     374 public:
     375  aTest() { last = 0.0;}
     376  ~aTest() {}
     377  void littleDebug(float f) {  diff = f - last; printf("f=%f, diff=%f\n", f,diff); last = f;}
     378 private:
     379  float diff;
     380  float last;
     381};
     382
     383//aTest::aTest() {}
     384//aTest::~aTest() {}
     385
     386//void aTest::littleDebug(float f)
     387
     388/**********************TEST*******************************/
     389
     390
    382391#endif /* _ANIMATION_H */
Note: See TracChangeset for help on using the changeset viewer.