Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 9, 2005, 10:50:20 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/trackManager: backloop-check created

File:
1 copied

Legend:

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

    r3455 r3463  
    1212
    1313   ### File Specific:
    14    main-programmer: Patrick Boenzli
     14   main-programmer: Benjamin Grauer
    1515   co-programmer: ...
    1616*/
    1717
    1818
     19#include "track_node.h"
     20
    1921#include "null_parent.h"
    2022
     23#include "track_manager.h"
    2124
    2225using namespace std;
    2326
    24 NullParent* NullParent::singletonRef = 0;
     27TrackNode* TrackNode::singletonRef = 0;
    2528
    26 NullParent* NullParent::getInstance ()
     29TrackNode* TrackNode::getInstance ()
    2730{
    28   if( singletonRef == NULL)
    29     singletonRef = new NullParent ();
     31  if (singletonRef == NULL)
     32    singletonRef = new TrackNode ();
    3033  return singletonRef;
    3134}
     
    3639   \todo this constructor is not jet implemented - do it
    3740*/
    38 NullParent::NullParent ()
     41TrackNode::TrackNode ()
    3942{
    40   this->parent = this;
     43  this->setParent(NullParent::getInstance());
     44  this->trackManager = TrackManager::getInstance();
    4145  this->mode = ALL;
    4246}
    4347
    4448
    45 NullParent::NullParent (Vector* absCoordinate)
     49TrackNode::TrackNode (Vector* absCoordinate)
    4650{
    47   this->parent = this;
     51  this->parent = NullParent::getInstance();
     52  this->trackManager = TrackManager::getInstance();
    4853  this->mode = ALL;
    4954  this->absCoordinate = *absCoordinate;
     
    5661   \todo this deconstructor is not jet implemented - do it
    5762*/
    58 NullParent::~NullParent ()
     63TrackNode::~TrackNode ()
    5964{
    60   delete singletonRef;
    6165  singletonRef = NULL;
    6266}
    63 
    64 
    65 
    6667
    6768/**
     
    7273   worry, normaly...
    7374*/
    74 void NullParent::update (float timeStamp)
     75void TrackNode::update (float timeStamp)
    7576{
    76   this->absCoordinate = this->relCoordinate;
    77   this->absDirection = parent->getAbsDir () * this->relDirection;
     77  this->absCoordinate = trackManager->calcPos();
     78  this->absDirection = Quaternion(trackManager->calcDir(), Vector(0,1,0));
    7879 
    7980  PNode* pn = this->children->enumerate ();
Note: See TracChangeset for help on using the changeset viewer.