Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 7, 2005, 3:07:12 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/trackManager: now env moves along the Path. but the Path does not decide for different tracks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/trackManager/src/track_manager.cc

    r3369 r3371  
    1919#include "track_manager.h"
    2020#include <stdarg.h>
    21 
     21#include "p_node.h"
    2222
    2323using namespace std;
     
    111111  this->maxTime = 0;
    112112  this->trackElemCount = 1;
     113  this->bindSlave = NULL;
    113114}
    114115
     
    440441void TrackManager::tick(float dt)
    441442{
     443  dt /= 1000;
     444  printf("LocalTime is: %f, timestep is: %f\n", this->localTime, dt);
    442445  if (this->localTime <= this->firstTrackElem->duration)
    443446    this->jumpTo(this->localTime);
     447  printf("LocalTime is: %f, timestep is: %f\n", this->localTime, dt);
    444448  this->localTime += dt;
    445449  if (this->localTime > this->currentTrackElem->startingTime + this->currentTrackElem->duration && this->currentTrackElem->childCount > 0)
    446450    this->currentTrackElem = this->currentTrackElem->children[0];
     451  if (this->bindSlave)
     452    {
     453      Vector tmp = this->calcPos();
     454      Quaternion quat = Quaternion(this->calcDir(), Vector(0,1,0));
     455      this->bindSlave->setAbsCoor(&tmp);
     456      this->bindSlave->setAbsDir(&quat);
     457    }
    447458}
    448459
     
    471482}
    472483
     484/**
     485   \brief Sets the PNode, that should be moved along the Tack
     486   \param bindSlave the PNode to set
     487*/
     488void TrackManager::setBindSlave(PNode* bindSlave)
     489{
     490  if (!this->bindSlave)
     491    this->bindSlave = bindSlave;
     492}
    473493
    474494
Note: See TracChangeset for help on using the changeset viewer.