Changeset 3463 in orxonox.OLD for orxonox/branches
- Timestamp:
- Mar 9, 2005, 10:50:20 AM (20 years ago)
- Location:
- orxonox/branches/trackManager/src
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/trackManager/src/Makefile.am
r3430 r3463 31 31 p_node.cc \ 32 32 null_parent.cc \ 33 track_node.cc \ 33 34 base_object.cc \ 34 35 helper_parent.cc \ … … 37 38 curve.cc \ 38 39 glmenu_imagescreen.cc \ 39 skysphere.cc 40 skysphere.cc 40 41 41 42 noinst_HEADERS = ability.h \ -
orxonox/branches/trackManager/src/Makefile.in
r3430 r3463 61 61 objModel.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \ 62 62 texture.$(OBJEXT) list.$(OBJEXT) p_node.$(OBJEXT) \ 63 null_parent.$(OBJEXT) base_object.$(OBJEXT) \64 helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \65 matrix.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \66 skysphere.$(OBJEXT)63 null_parent.$(OBJEXT) track_node.$(OBJEXT) \ 64 base_object.$(OBJEXT) helper_parent.$(OBJEXT) \ 65 track_manager.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \ 66 glmenu_imagescreen.$(OBJEXT) skysphere.$(OBJEXT) 67 67 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 68 68 orxonox_LDADD = $(LDADD) … … 87 87 @AMDEP_TRUE@ ./$(DEPDIR)/player.Po ./$(DEPDIR)/skysphere.Po \ 88 88 @AMDEP_TRUE@ ./$(DEPDIR)/story_entity.Po ./$(DEPDIR)/texture.Po \ 89 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \ 89 @AMDEP_TRUE@ ./$(DEPDIR)/track_manager.Po \ 90 @AMDEP_TRUE@ ./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \ 90 91 @AMDEP_TRUE@ ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po 91 92 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ … … 240 241 p_node.cc \ 241 242 null_parent.cc \ 243 track_node.cc \ 242 244 base_object.cc \ 243 245 helper_parent.cc \ … … 246 248 curve.cc \ 247 249 glmenu_imagescreen.cc \ 248 skysphere.cc 250 skysphere.cc 249 251 250 252 noinst_HEADERS = ability.h \ … … 396 398 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 397 399 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@ 400 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_node.Po@am__quote@ 398 401 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ 399 402 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world.Po@am__quote@ -
orxonox/branches/trackManager/src/track_manager.cc
r3432 r3463 88 88 89 89 90 /** 91 \brief checks if there are any BackLoops in the Track 92 \param trackElem the trackElement to check about 93 it simply does this by looking if the current trackElem is found again somewhere else in the Track 94 */ 95 bool TrackElement::backLoopCheck(TrackElement* trackElem) 96 { 97 if (this->childCount == 0) 98 return true; 99 else 100 { 101 for (int i = 0; i < this->childCount; i++) 102 if(!this->children[i]->backLoopCheck(trackElem)) 103 return false; 104 105 return true; 106 } 107 } 90 108 91 109 … … 137 155 TrackManager* TrackManager::getInstance(void) 138 156 { 139 if ( singletonRef)140 return singletonRef;157 if (TrackManager::singletonRef) 158 return TrackManager::singletonRef; 141 159 else 142 return singletonRef = new TrackManager();160 return TrackManager::singletonRef = new TrackManager(); 143 161 } 144 162 … … 370 388 { 371 389 printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]); 390 391 // checking if there is a back-loop-connection and ERROR if it is. 392 TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]); 393 if (!tmpTrackElem->backLoopCheck(tmpTrackElem)) 394 PRINTF(1)("Backloop connection detected at joining trackElements\n"); 372 395 373 396 // chanching work-on to temporary value. going back at the end. -
orxonox/branches/trackManager/src/track_manager.h
r3430 r3463 35 35 36 36 TrackElement* findByID(unsigned int trackID); 37 bool backLoopCheck(TrackElement* trackElem); 37 38 38 39 bool isFresh; //!< If no Points where added until now -
orxonox/branches/trackManager/src/track_node.cc
r3455 r3463 12 12 13 13 ### File Specific: 14 main-programmer: Patrick Boenzli14 main-programmer: Benjamin Grauer 15 15 co-programmer: ... 16 16 */ 17 17 18 18 19 #include "track_node.h" 20 19 21 #include "null_parent.h" 20 22 23 #include "track_manager.h" 21 24 22 25 using namespace std; 23 26 24 NullParent* NullParent::singletonRef = 0;27 TrackNode* TrackNode::singletonRef = 0; 25 28 26 NullParent* NullParent::getInstance ()29 TrackNode* TrackNode::getInstance () 27 30 { 28 if (singletonRef == NULL)29 singletonRef = new NullParent();31 if (singletonRef == NULL) 32 singletonRef = new TrackNode (); 30 33 return singletonRef; 31 34 } … … 36 39 \todo this constructor is not jet implemented - do it 37 40 */ 38 NullParent::NullParent()41 TrackNode::TrackNode () 39 42 { 40 this->parent = this; 43 this->setParent(NullParent::getInstance()); 44 this->trackManager = TrackManager::getInstance(); 41 45 this->mode = ALL; 42 46 } 43 47 44 48 45 NullParent::NullParent(Vector* absCoordinate)49 TrackNode::TrackNode (Vector* absCoordinate) 46 50 { 47 this->parent = this; 51 this->parent = NullParent::getInstance(); 52 this->trackManager = TrackManager::getInstance(); 48 53 this->mode = ALL; 49 54 this->absCoordinate = *absCoordinate; … … 56 61 \todo this deconstructor is not jet implemented - do it 57 62 */ 58 NullParent::~NullParent()63 TrackNode::~TrackNode () 59 64 { 60 delete singletonRef;61 65 singletonRef = NULL; 62 66 } 63 64 65 66 67 67 68 /** … … 72 73 worry, normaly... 73 74 */ 74 void NullParent::update (float timeStamp)75 void TrackNode::update (float timeStamp) 75 76 { 76 this->absCoordinate = t his->relCoordinate;77 this->absDirection = parent->getAbsDir () * this->relDirection;77 this->absCoordinate = trackManager->calcPos(); 78 this->absDirection = Quaternion(trackManager->calcDir(), Vector(0,1,0)); 78 79 79 80 PNode* pn = this->children->enumerate (); -
orxonox/branches/trackManager/src/track_node.h
r3455 r3463 1 1 /*! 2 \file proto_class.h 3 \brief Definition of the proto class template, used quickly start work 2 \file track_node.h 3 \brief Definition of the TrackNode are located here 4 5 the TrackNode is the node, that follows the Track (and the TrackManager) 6 through the level. 7 Under normal confitions the Plyaer(s) are 4 8 */ 5 9 6 10 7 #ifndef _ NULL_PARENT_H8 #define _ NULL_PARENT_H11 #ifndef _TRACK_NODE_H 12 #define _TRACK_NODE_H 9 13 10 #include "stdincl.h"11 14 #include "p_node.h" 12 15 16 /* FORWARD DEFINITION */ 17 class TrackManager; 13 18 14 class NullParent: public PNode {19 class TrackNode : public PNode { 15 20 16 21 public: 17 static NullParent* getInstance ();18 ~ NullParent();22 static TrackNode* getInstance (); 23 ~TrackNode (); 19 24 20 static NullParent* singletonRef;21 22 25 virtual void update (float timeStamp); 23 26 24 27 private: 25 NullParent (); 26 NullParent (Vector* absCoordinate); 28 TrackNode (); 29 TrackNode (Vector* absCoordinate); 30 31 static TrackNode* singletonRef; 32 TrackManager* trackManager; 27 33 28 34 }; 29 35 30 #endif /* _ NULL_PARENT_H */36 #endif /* _TRACK_NODE_H */ -
orxonox/branches/trackManager/src/world.cc
r3430 r3463 28 28 #include "glmenu_imagescreen.h" 29 29 #include "skysphere.h" 30 #include "track_node.h" 30 31 31 32 using namespace std; … … 294 295 env->setName ("env"); 295 296 this->spawn(env, es, qs); 296 trackManager->setBindSlave(env); 297 298 trackNode = TrackNode::getInstance(); 299 300 env->setParent(trackNode); 301 302 trackManager->setBindSlave(trackNode); 297 303 298 304 break; -
orxonox/branches/trackManager/src/world.h
r3430 r3463 80 80 81 81 PNode* nullParent; 82 PNode* trackNode; 82 83 83 84 void mainLoop ();
Note: See TracChangeset
for help on using the changeset viewer.