Changeset 4489 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 3, 2005, 1:21:05 AM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r4488 r4489 409 409 PRINTF(4)("Loading Track\n"); 410 410 411 trackManager->load ( element);411 trackManager->loadParams( element); 412 412 trackManager->finalize(); 413 413 } -
orxonox/trunk/src/util/track/track_manager.cc
r4320 r4489 148 148 \brief checks if there are any BackLoops in the Track (Backloops only 149 149 \param trackElem the trackElement to check about 150 \param depth the depth to search in 150 151 \returns true if NO loop was found, false Otherwise 151 152 You actually have to act on false!! 152 153 it simply does this by looking if the current trackElem is found again somewhere else in the Track 154 155 \todo this has to be reimplemented 153 156 */ 154 157 bool TrackElement::backLoopCheck(const TrackElement* trackElem, unsigned int depth) const … … 177 180 178 181 /** 179 \param child Numberwhich child to return182 \param childCount which child to return 180 183 \returns the n-the children (starting at 0). 181 184 Be aware, that when the trackElement has no Children, NULL will be returned … … 217 220 218 221 /** 219 \returns The name of this TrackElement220 */221 const char* TrackElement::getName(void) const222 {223 return this->name;224 }225 226 /**227 222 \brief prints out debug information about this TrackElement 228 223 */ … … 404 399 \param root the TiXmlElement to load the Data from 405 400 */ 406 bool TrackManager::load ( TiXmlElement* root)401 bool TrackManager::loadParams( TiXmlElement* root) 407 402 { 408 403 TiXmlElement* element; … … 489 484 } 490 485 491 492 493 486 /** 494 487 \brief standard destructor … … 509 502 //! Singleton Reference to TrackManager 510 503 TrackManager* TrackManager::singletonRef = NULL; 511 512 /**513 \returns The reference on the TrackManager.514 515 If the TrackManager does not exist, it will be created.516 */517 TrackManager* TrackManager::getInstance(void)518 {519 if (!TrackManager::singletonRef)520 TrackManager::singletonRef = new TrackManager();521 return TrackManager::singletonRef;522 }523 524 504 525 505 // INITIALIZE // … … 655 635 \brief adds save/splitpoint. 656 636 \param newPoint The point to add. 637 \param trackElem if supplied it will add a hotpoint on this TrackElement 657 638 \returns A Pointer to a newly appended Curve 658 639 */ … … 721 702 722 703 /** 723 \param string the String to parse. 704 \param count how many children to produce 705 \param ... the information on the children (these are the Stings of their names 724 706 \see TrackManager::fork(unsigned int count, ...) 725 707 … … 760 742 \param count The Count of childrens the current HotPoint will have. 761 743 \param trackIDs A Pointer to an Array of ints which will hold the trackID's (the user will have to reserve space for this). 744 \param trackNames the names for the tracks as a char-arrey-array 762 745 \param trackElem The TrackElement to appy this to. (if NULL choose this->currentTrackElement) 763 746 \see TrackManager::fork(unsigned int count, ...) -
orxonox/trunk/src/util/track/track_manager.h
r4381 r4489 16 16 17 17 #ifndef NULL 18 #define NULL 018 #define NULL 0 //!< NULL 19 19 #endif 20 20 … … 28 28 // Static Definitions 29 29 30 //! The Default Curve-Type to set for the whole path (if not chosen otherwise). 31 #define TMAN_DEFAULT_CURVETYPE CURVE_BEZIER 32 #define TMAN_DEFAULT_DURATION 10 33 #define TMAN_DEFAULT_WIDTH 10 30 //! The default Curve-Type to set for the whole path (if not chosen otherwise). 31 #define TMAN_DEFAULT_CURVETYPE CURVE_BEZIER 32 //! A default value for the duration for each TrackElement 33 #define TMAN_DEFAULT_DURATION 10 34 //! A default width for the width of a TrackElement 35 #define TMAN_DEFAULT_WIDTH 10 34 36 35 37 //! A Graph-Element, that holds the curve-structure of a Level. … … 50 52 TrackElement* getChild(int childNumber) const; 51 53 void setName(const char* name); 52 const char* getName(void) const; 54 /** \returns the Name of this TrackElement */ 55 inline const char* getName(void) const { return this->name; }; 56 53 57 54 58 // atributes 55 bool isFresh; //!< If no Points where added until now56 bool isHotPoint; //!< If the first node is a specialPoint;57 bool isSavePoint; //!< If the first node is a savePoint58 bool isFork; //!< If the first node is a Fork59 bool isJoined; //!< If the End of the Curve is joined.60 bool mainJoin; //!< If the End of the Curve is joined, and this is the one Curve the others join to.61 int ID;//!< The ID of this TrackElement62 float startingTime;//!< The time at which this Track begins.63 float duration;//!< The time used to cross this TrackElement (curve).64 float endTime;//!< The time at which this Track ends.65 float jumpTime;//!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)66 float width;//!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.67 int nodeCount;//!< The count of points this TrackElement has.68 Curve* curve;//!< The Curve of this TrackElement69 int childCount;//!< The number of Children This TrackElement has.70 tList<TrackElement>* children;//!< A TrackElement can have a Tree of following TrackElements.59 bool isFresh; //!< If no Points where added until now 60 bool isHotPoint; //!< If the first node is a specialPoint; 61 bool isSavePoint; //!< If the first node is a savePoint 62 bool isFork; //!< If the first node is a Fork 63 bool isJoined; //!< If the End of the Curve is joined. 64 bool mainJoin; //!< If the End of the Curve is joined, and this is the one Curve the others join to. 65 int ID; //!< The ID of this TrackElement 66 float startingTime; //!< The time at which this Track begins. 67 float duration; //!< The time used to cross this TrackElement (curve). 68 float endTime; //!< The time at which this Track ends. 69 float jumpTime; //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true) 70 float width; //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right. 71 int nodeCount; //!< The count of points this TrackElement has. 72 Curve* curve; //!< The Curve of this TrackElement 73 int childCount; //!< The number of Children This TrackElement has. 74 tList<TrackElement>* children; //!< A TrackElement can have a Tree of following TrackElements. 71 75 72 76 … … 133 137 class TrackManager : public BaseObject 134 138 { 135 private:136 TrackManager(void);137 138 static TrackManager* singletonRef; //!< There may only be one TrackManager.139 140 TrackElement* firstTrackElem; //!< The first TrackElement that exists.141 TrackElement* currentTrackElem; //!< The TrackElement we are working on.142 CurveType curveType; //!< The CurveType the entire TrackSystem will have.143 float localTime; //!< The time that has been passed since the traveling the Track.144 float maxTime; //!< The maximal time the track has.145 int trackElemCount; //!< The count of TrackElements that exist.146 147 // external148 PNode* bindSlave; //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.149 PNode* trackNode; //!< The main TrackNode of this Track.150 Text* trackText; //!< The text to display when switching between Worlds.151 tAnimation<Text>* textAnimation; //!< An Animation for the Text.152 153 void initChildren(unsigned int childCount, TrackElement* trackElem = NULL);154 155 139 public: 156 140 virtual ~TrackManager(void); 157 158 static TrackManager* getInstance(void);159 160 bool load (TiXmlElement* root);141 /** \returns a Pointer to the only object of this Class */ 142 inline static TrackManager* getInstance(void) { if (!singletonRef) singletonRef = new TrackManager(); return singletonRef; }; 143 144 bool loadParams(TiXmlElement* root); 161 145 162 146 // Methods to change the Path (initialisation) … … 197 181 void drawGraph(float dt) const; 198 182 void debug(unsigned int level) const; 183 184 private: 185 TrackManager(void); 186 void initChildren(unsigned int childCount, TrackElement* trackElem = NULL); 187 188 private: 189 static TrackManager* singletonRef; //!< There may only be one TrackManager. 190 191 TrackElement* firstTrackElem; //!< The first TrackElement that exists. 192 TrackElement* currentTrackElem; //!< The TrackElement we are working on. 193 CurveType curveType; //!< The CurveType the entire TrackSystem will have. 194 float localTime; //!< The time that has been passed since the traveling the Track. 195 float maxTime; //!< The maximal time the track has. 196 int trackElemCount; //!< The count of TrackElements that exist. 197 198 // external 199 PNode* bindSlave; //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself. 200 PNode* trackNode; //!< The main TrackNode of this Track. 201 Text* trackText; //!< The text to display when switching between Worlds. 202 tAnimation<Text>* textAnimation; //!< An Animation for the Text. (for fading it out on trackName-change) 199 203 }; 200 204 -
orxonox/trunk/src/util/track/track_node.cc
r4444 r4489 27 27 /** 28 28 \brief standard constructor 29 30 \todo this constructor is not jet implemented - do it31 29 */ 32 30 TrackNode::TrackNode () … … 43 41 /** 44 42 \brief standard deconstructor 45 46 \todo this deconstructor is not jet implemented - do it47 43 */ 48 44 TrackNode::~TrackNode () -
orxonox/trunk/src/util/track/track_node.h
r4262 r4489 17 17 class TrackManager; 18 18 19 //! A node that follows the track. 19 20 class TrackNode : public PNode 20 21 { … … 22 23 public: 23 24 TrackNode (); 24 TrackNode (const Vector& absCoordinate);25 26 25 virtual ~TrackNode (); 27 26 28 27 private: 29 TrackManager* trackManager; 28 TrackManager* trackManager; //!< reference to the TrackManager 30 29 31 30 };
Note: See TracChangeset
for help on using the changeset viewer.