Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3831 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Apr 14, 2005, 2:54:02 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: implemente animation sine function

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r3830 r3831  
    328328float tAnim<T>::sine(float timePassed) const
    329329{
     330  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
     331  float e = 0.5 * d * (1 - cos(M_PI * timePassed / this->currentKeyFrame->duration));
     332  //printf("d=%f, t=%f, T=%f\n", d, timePassed, this->currentKeyFrame->duration);
     333  return this->currentKeyFrame->value - e;
     334  /*
    330335  return this->currentKeyFrame->value - (this->nextKeyFrame->value - this->currentKeyFrame->value)
    331336    * sin(timePassed / this->currentKeyFrame->duration * M_PI);
     337  */
    332338}
    333339
  • orxonox/trunk/src/lib/util/list.h

    r3790 r3831  
    7878
    7979template<class T>
    80 tIterator<T>::~tIterator ()
     80inline tIterator<T>::~tIterator ()
    8181{
    8282  this->currentEl = NULL;
     
    126126
    127127template<class T>
    128 tList<T>::tList ()
     128inline tList<T>::tList ()
    129129{
    130130  this->first = NULL;
     
    134134
    135135template<class T>
    136 tList<T>::~tList ()
     136inline tList<T>::~tList ()
    137137{
    138138  this->currentEl = this->first;
     
    153153inline void tList<T>::add(T* entity)
    154154{
    155   if( entity == NULL) return;
     155  __UNLIKELY_IF( entity == NULL) return;
    156156  listElement<T>* el = new listElement<T>;
    157157  el->prev = this->last;
     
    161161  this->last = el;
    162162
    163   if(el->prev == NULL) this->first = el; /* if first element */
     163  __UNLIKELY_IF(el->prev == NULL) this->first = el; /* if first element */
    164164  else el->prev->next = el;
    165165  this->size++;
     
    170170inline void tList<T>::remove(T* entity)
    171171{
    172   if( entity == NULL) return;
     172  //__UNLIKELY( entity == NULL) return;
    173173  this->currentEl = this->first;
    174174  listElement<T>* te;
     
    196196
    197197template<class T>
    198 void tList<T>::destroy()
     198inline void tList<T>::destroy()
    199199{
    200200  this->currentEl = this->first;
     
    213213
    214214template<class T>
    215 T* tList<T>::firstElement()
     215inline T* tList<T>::firstElement()
    216216{
    217217  return this->first->curr;
     
    219219
    220220template<class T>
    221 T* tList<T>::lastElement()
     221inline T* tList<T>::lastElement()
    222222{
    223223  return this->last->curr;
     
    226226
    227227template<class T>
    228 bool tList<T>::isEmpty()
     228inline bool tList<T>::isEmpty()
    229229{
    230230  return (this->size==0)?true:false;
     
    233233
    234234template<class T>
    235 int tList<T>::getSize()
     235inline int tList<T>::getSize()
    236236{
    237237  return this->size;
     
    239239
    240240
     241/* deprecated */
    241242template<class T>
    242243T* tList<T>::enumerate()
     
    257258
    258259
     260/* deprecated */
    259261template<class T>
    260262T* tList<T>::nextElement()
     
    272274*/
    273275template<class T>
    274 T* tList<T>::nextElement(T* toEntity)
     276inline T* tList<T>::nextElement(T* toEntity)
    275277{
    276278  //if( this->last == this->first == NULL) return NULL;
  • orxonox/trunk/src/story_entities/world.cc

    r3828 r3831  
    380380            aTest* test = new aTest();
    381381            tAnim<aTest>* testAnim = new tAnim<aTest>(test, &aTest::littleDebug);
    382             testAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR);
    383             testAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
     382            testAnim->addKeyFrame(0.0, 1.0, ANIM_SINE);
     383            testAnim->addKeyFrame(3.5, 1.0, ANIM_SINE);
    384384            //testAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR);
    385385            //testAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR);
Note: See TracChangeset for help on using the changeset viewer.