Changeset 3556 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Mar 15, 2005, 2:34:44 AM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r3553 r3556 248 248 249 249 // trackManager->setBindSlave(env); 250 TrackNode* tn = TrackNode::getInstance();250 PNode* tn = trackManager->getTrackNode(); 251 251 tn->addChild(myPlayer); 252 252 253 253 //localCamera->setParent(TrackNode::getInstance()); 254 TrackNode::getInstance()->addChild (this->localCamera);254 tn->addChild (this->localCamera); 255 255 //Vector* cameraOffset = new Vector (0, 5, -10); 256 256 Vector* cameraOffset = new Vector (-10, 5, 0); … … 703 703 this->display (); 704 704 705 (TrackNode::getInstance()->getAbsCoor() - localPlayer->getAbsCoor()).debug();706 707 705 for( int i = 0; i < 5000000; i++) {} 708 706 /* \todo this is to slow down the program for openGl Software emulator computers, reimplement*/ -
orxonox/trunk/src/track_manager.cc
r3546 r3556 217 217 this->maxTime = 0; 218 218 this->trackElemCount = 1; 219 this->bindSlave = TrackNode::getInstance();219 this->bindSlave = this->trackNode = new TrackNode(); 220 220 } 221 221 … … 701 701 void TrackManager::setBindSlave(PNode* bindSlave) 702 702 { 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 */ 709 PNode* TrackManager::getTrackNode(void) 710 { 711 return this->trackNode; 712 } 709 713 710 714 // DEBUG // -
orxonox/trunk/src/track_manager.h
r3544 r3556 115 115 int trackElemCount; //!< The count of TrackElements that exist. 116 116 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. 117 118 118 119 void initChildren(unsigned int childCount); … … 151 152 152 153 void setBindSlave(PNode* bindSlave); 154 PNode* getTrackNode(void); 153 155 154 156 // DEBUG // -
orxonox/trunk/src/track_node.cc
r3545 r3556 25 25 using namespace std; 26 26 27 TrackNode* TrackNode::singletonRef = 0;28 29 TrackNode* TrackNode::getInstance ()30 {31 if (!singletonRef)32 singletonRef = new TrackNode ();33 return singletonRef;34 }35 36 27 /** 37 28 \brief standard constructor … … 43 34 this->setClassName("TrackNode"); 44 35 this->setName("TrackNode"); /* absolete but still used... */ 45 singletonRef = this;46 36 47 37 NullParent::getInstance()->addChild(this); 48 38 this->trackManager = TrackManager::getInstance(); 49 this-> mode = ALL;39 this->setMode(ALL); 50 40 } 51 41 … … 55 45 this->parent = NullParent::getInstance(); 56 46 this->trackManager = TrackManager::getInstance(); 57 this-> mode = ALL;47 this->setMode(ALL); 58 48 this->absCoordinate = *absCoordinate; 59 49 } … … 67 57 TrackNode::~TrackNode () 68 58 { 69 singletonRef = NULL; 59 70 60 } -
orxonox/trunk/src/track_node.h
r3544 r3556 20 20 21 21 public: 22 static TrackNode* getInstance (); 22 TrackNode (); 23 TrackNode (Vector* absCoordinate); 24 23 25 virtual ~TrackNode (); 24 26 25 27 private: 26 TrackNode ();27 TrackNode (Vector* absCoordinate);28 29 static TrackNode* singletonRef;30 28 TrackManager* trackManager; 31 29
Note: See TracChangeset
for help on using the changeset viewer.