Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3964 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Apr 25, 2005, 11:45:57 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: implemented neg_exp function again. better than ever :)

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r3870 r3964  
    4444#include "list.h"
    4545
     46#include "animation3d.h"
    4647
    4748
     
    465466
    466467           
    467            
    468 
    469             WorldEntity* b = new Environment();
    470             this->localPlayer->addChild(b);
    471             b->setRelCoor(Vector(10.0, 1.0, 1.0));
    472             this->spawn(b);
    473 
    474            
     468   
    475469            WorldEntity* c = new Environment();
    476470            this->localPlayer->addChild(c);
     
    478472            this->spawn(c);
    479473           
     474           
     475            Animation3D* animation = new Animation3D(c);
     476            animation->setInfinity(ANIM_INF_REPLAY);
     477            animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_NEG_EXP);
     478            animation->addKeyFrame(Vector(5, 5, -5), Quaternion(), 1.0, ANIM_NEG_EXP);
     479            animation->addKeyFrame(Vector(0, 0, 0), Quaternion(), 1.0, ANIM_NEG_EXP);
     480
     481
    480482            /*     
    481483                  KeyFrame* f1 = new KeyFrame;
  • orxonox/trunk/src/util/animation/animation3d.cc

    r3876 r3964  
    134134          if( this->currentKeyFrame->animFunc == ANIM_NEG_EXP)
    135135            {
    136               this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
    137               this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
     136
    138137            }
    139138        }
     
    206205    case ANIM_NEG_EXP:
    207206      this->animFunc = &Animation3D::negExp;
     207      //this->tmpVect = this->nextKeyFrame->position - this->currentKeyFrame->position;
     208      //this->deltaT = 1/this->currentKeyFrame->duration * logf(1.0 + 600.0/this->tmpVect.len());
     209      this->expFactor = -1.0 / this->currentKeyFrame->duration * logf(DELTA_X_3D);
     210        //(this->currentKeyFrame->position - this->nextKeyFrame->position)
     211
     212      /*
     213        float d = fabs(this->currentKeyFrame->value - this->nextKeyFrame->value);
     214        expFactor =  - 1.0 / this->currentKeyFrame->duration * logf(DELTA_X);
     215
     216      */
    208217      break;
    209218    case ANIM_QUADRATIC:
     
    284293void Animation3D::negExp(float timePassed) const
    285294{
    286   this->linear(timePassed);
    287 }
     295  this->object->setRelCoor( this->currentKeyFrame->position +
     296                            (this->nextKeyFrame->position - this->currentKeyFrame->position) *
     297                            (1.0 - expf(- timePassed * expFactor)) );
     298}
     299
     300/*
     301  float d = this->currentKeyFrame->value - this->nextKeyFrame->value;
     302  float e = d * (1.0 - expf(- timePassed * expFactor));
     303  return  this->currentKeyFrame->value - e;
     304*/
     305
    288306
    289307/**
  • orxonox/trunk/src/util/animation/animation3d.h

    r3868 r3964  
    88#include "vector.h"
    99class PNode;
     10
     11#define DELTA_X_3D 0.05  //!< the percentag of the distance that doesnt have to be done by neg_exp (asymptotical) ~ maschinendelta
    1012
    1113//! KeyFrame3D Struct
     
    6062  Vector tmpVect;        //!< what for??
    6163  float deltaT;          //!< ??
     64  float expFactor;
    6265};
  • orxonox/trunk/src/world_entities/environment.cc

    r3739 r3964  
    5050void Environment::draw ()
    5151{
     52  //this->getRelCoor()->debug();
     53
    5254  glMatrixMode(GL_MODELVIEW);
    5355  glPushMatrix();
Note: See TracChangeset for help on using the changeset viewer.