Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3556 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Mar 15, 2005, 2:34:44 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: trackNode not static anymore

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

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

    r3553 r3556  
    248248
    249249            //      trackManager->setBindSlave(env);
    250             TrackNode* tn = TrackNode::getInstance();
     250            PNode* tn = trackManager->getTrackNode();
    251251            tn->addChild(myPlayer);
    252252
    253253            //localCamera->setParent(TrackNode::getInstance());
    254             TrackNode::getInstance()->addChild (this->localCamera);
     254            tn->addChild (this->localCamera);
    255255            //Vector* cameraOffset = new Vector (0, 5, -10);
    256256            Vector* cameraOffset = new Vector (-10, 5, 0);
     
    703703      this->display ();
    704704
    705       (TrackNode::getInstance()->getAbsCoor() - localPlayer->getAbsCoor()).debug();
    706  
    707705      for( int i = 0; i < 5000000; i++) {}
    708706      /* \todo this is to slow down the program for openGl Software emulator computers, reimplement*/
  • orxonox/trunk/src/track_manager.cc

    r3546 r3556  
    217217  this->maxTime = 0;
    218218  this->trackElemCount = 1;
    219   this->bindSlave = TrackNode::getInstance();
     219  this->bindSlave = this->trackNode = new TrackNode();
    220220}
    221221
     
    701701void TrackManager::setBindSlave(PNode* bindSlave)
    702702{
    703   if (this->bindSlave == TrackNode::getInstance() || bindSlave == TrackNode::getInstance())
    704     this->bindSlave = bindSlave;
    705   else
    706     PRINTF(2)("Already a Bindslave set that is not the TrackNode itself. Not updating\n");
    707 }
    708 
     703  this->bindSlave = bindSlave;
     704}
     705
     706/**
     707   \returns the main TrackNode
     708*/
     709PNode* TrackManager::getTrackNode(void)
     710{
     711  return this->trackNode;
     712}
    709713
    710714// DEBUG //
  • orxonox/trunk/src/track_manager.h

    r3544 r3556  
    115115  int trackElemCount;                 //!< The count of TrackElements that exist.
    116116  PNode* bindSlave;                   //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
     117  PNode* trackNode;                   //!< The main TrackNode of this Track.
    117118 
    118119  void initChildren(unsigned int childCount);
     
    151152
    152153  void setBindSlave(PNode* bindSlave);
     154  PNode* getTrackNode(void);
    153155
    154156  // DEBUG //
  • orxonox/trunk/src/track_node.cc

    r3545 r3556  
    2525using namespace std;
    2626
    27 TrackNode* TrackNode::singletonRef = 0;
    28 
    29 TrackNode* TrackNode::getInstance ()
    30 {
    31   if (!singletonRef)
    32     singletonRef = new TrackNode ();
    33   return singletonRef;
    34 }
    35 
    3627/**
    3728   \brief standard constructor
     
    4334  this->setClassName("TrackNode");
    4435  this->setName("TrackNode"); /* absolete but still used... */
    45   singletonRef = this;
    4636
    4737  NullParent::getInstance()->addChild(this);
    4838  this->trackManager = TrackManager::getInstance();
    49   this->mode = ALL;
     39  this->setMode(ALL);
    5040}
    5141
     
    5545  this->parent = NullParent::getInstance();
    5646  this->trackManager = TrackManager::getInstance();
    57   this->mode = ALL;
     47  this->setMode(ALL);
    5848  this->absCoordinate = *absCoordinate;
    5949}
     
    6757TrackNode::~TrackNode ()
    6858{
    69   singletonRef = NULL;
     59
    7060}
  • orxonox/trunk/src/track_node.h

    r3544 r3556  
    2020
    2121 public:
    22   static TrackNode* getInstance ();
     22  TrackNode ();
     23  TrackNode (Vector* absCoordinate);
     24
    2325  virtual ~TrackNode ();
    2426
    2527 private:
    26   TrackNode ();
    27   TrackNode (Vector* absCoordinate);
    28 
    29   static TrackNode* singletonRef;
    3028  TrackManager* trackManager;
    3129
Note: See TracChangeset for help on using the changeset viewer.