Changeset 3331 in orxonox.OLD for orxonox/branches/parenting/src/track_manager.h
- Timestamp:
- Jan 4, 2005, 1:39:32 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/track_manager.h
r3330 r3331 13 13 14 14 #include "stdincl.h" 15 16 17 //! condition for choosing a certain Path. \todo implement a useful way. 18 struct PathCondition 19 { 20 21 }; 22 23 24 //! A Graph-Element, that holds the curve-structure of a Level. 25 /** 26 A TrackElement is used, to define the structure of the Track itself. 27 It is a graph and not a tree, because paths can fork and join again. 28 */ 29 class TrackElement 30 { 31 public: 32 TrackElement(void); 33 ~TrackElement(void); 34 35 bool isSavePoint; //!< If the first node is a savePoint 36 bool isFork; //!< If the first node is a Fork 37 bool isJoined; //!< If the End of the Curve is joined. 38 PathCondition cond; //!< The Split Condition; 39 int ID; //!< The ID of this TrackElement 40 float length; //!< The time usedto cross this TrackElement (curve). 41 CurveType curveType; //!< The CurveType this will have. 42 int nodeCount; //!< The count of points this TrackElement has. 43 Curve* curve; //!< The Curve of this TrackElement 44 int childCount; //!< The number of Children This TrackElement has. 45 TrackElement** children; //!< A TrackElement can have a Tree of following TrackElements. 46 }; 47 15 48 16 49 … … 42 75 43 76 TrackManager can be handled as a StateMachine. 77 \n\n 78 Names: 79 \li TrackManager: handles Tracks 80 \li Track: The Track that the ship can follow 81 \li Path: one way through the Level, that is dependent on conditionals. 82 \li Conditional: A decition making device, that chooses betwen different TrackElements for the Path. 83 \li TrackElement: A Part of A whole Track 44 84 */ 45 class TrackManager : public BaseObject { 85 class TrackManager : public BaseObject 86 { 46 87 private: 47 //! condition for choosing a certain Path. \todo implement a useful way. 48 struct PathCondition 49 { 50 51 }; 88 TrackManager(void); 89 90 static TrackManager* singletonRef; //!< There may only be one TrackManager existing. 91 TrackElement* firstTrackElem; //!< The first TrackElement that exists. 92 TrackElement* currentTrackElem; //!< The TrackElement we are working on. 93 float localTime; //!< The time that has been passed since the traveling the Track. 94 float maxTime; //!< The maximal time the track has. 95 int trackElemCount; //!< The count of TrackElements that exist. 52 96 53 //! A Graph, that holds the curve-structure of a Level.54 /**55 A CurveGraph is used, to Define the structure of the Track itself.56 It is a graph and not a tree, because paths can fork and join again.57 */58 struct TrackElement59 {60 bool isSavePoint; //!< If the first node is a savePoint61 bool isFork; //!< If the first node is a Fork62 bool isJoined; //!< If the End of the Curve is joined.63 PathCondition cond; //!< The Split Condition;64 int ID; //!< The ID of this TrackElement65 float length; //!< The time usedto cross this TrackElement (curve).66 CurveType curveType; //!< The CurveType this will have.67 int nodeCount; //!< The count of points this TrackElement has.68 Curve* curve; //!< The Curve of this TrackElement69 TrackElement** children; //!< A TrackElement can have a Tree of following TrackElements.70 };71 97 72 73 TrackElement* firstGraph; //!< The first Graph-element we are on. 74 TrackElement* currentGraph; //!< The Graph-element we are working on. 75 float localTime; //!< The time that has been passed since the traveling the Track. 76 int trackElementCount; //!< The count of TrackElements that exist. 98 TrackElement findTrackElementByID(int trackID); 77 99 78 TrackElement findTrackElementByID(int trackID);79 100 80 101 public: 81 TrackManager ();82 ~TrackManager ();102 ~TrackManager(void); 103 static TrackManager* getInstance(void); 83 104 84 105 // Methods to change the Path (initialisation) … … 99 120 Vector calcDir(); 100 121 void tick(float dt); 122 void jumpTo(float time); 101 123 void choosePath(int graphID); 102 124
Note: See TracChangeset
for help on using the changeset viewer.