Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 18, 2005, 11:52:15 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged trunk back to levelloader
merged with command:
svn merge -r 3499:HEAD trunk branches/levelloader

Conflicts in
C track_manager.h
C world_entities/player.cc
C world_entities/player.h
C world_entities/environment.h
C lib/coord/p_node.cc
C defs/debug.h
C track_manager.cc
C story_entities/campaign.h

solved in merge-favouring. It was quite easy because Chris only worked on the headers, and he didi it quite clean. Thats the spirit :)

Conflits in world.cc are a MESS: fix it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/track_manager.h

    r3530 r3605  
    1919class TrackNamer;
    2020
    21 //! condition for choosing a certain Path. \todo implement a useful way.
    22 struct PathCondition
    23 {
    24  
    25 };
    26  
     21// Static Definitions
     22
     23//! The Default Curve-Type to set for the whole path (if not chosen otherwise).
     24#define TMAN_DEFAULT_CURVETYPE BEZIERCURVE
     25#define TMAN_DEFAULT_DURATION 10
     26#define TMAN_DEFAULT_WIDTH    10
    2727
    2828//! A Graph-Element, that holds the curve-structure of a Level.
     
    3838
    3939  TrackElement* findByID(unsigned int trackID);
     40
    4041  TrackElement* findByName(const char* trackName);
    41         void setName( const char* trackName);
    4242       
     43  bool backLoopCheck(TrackElement* trackElem);
     44
     45  TrackElement* getChild(int childNumber);
     46  void setName(const char* name);
     47  char* getName(void) const;
     48
     49  // atributes
    4350  bool isFresh;              //!< If no Points where added until now
    4451  bool isHotPoint;           //!< If the first node is a specialPoint;
     
    4754  bool isJoined;             //!< If the End of the Curve is joined.
    4855  bool mainJoin;             //!< If the End of the Curve is joined, and this is the one Curve the others join to.
    49   PathCondition cond;        //!< The Split Condition;
    5056  int ID;                    //!< The ID of this TrackElement
    5157  float startingTime;        //!< The time at which this Track begins.
     
    5359  float endTime;             //!< The time at which this Track ends.
    5460  float jumpTime;            //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)
    55   CurveType curveType;       //!< The CurveType this will have.
     61  float width;               //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
    5662  int nodeCount;             //!< The count of points this TrackElement has.
    57   char* name;                //!< A name for the Trac.
    5863  Curve* curve;              //!< The Curve of this TrackElement
    5964  int childCount;            //!< The number of Children This TrackElement has.
    60   TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
     65  tList<TrackElement>* children;   //!< A TrackElement can have a Tree of following TrackElements.
     66
     67
     68  // runtime
     69  TrackElement* history;     //!< a pointer to the last TrackElement we were on. This is if you want to walk the path backwards again.
     70
     71  void debug(void);
     72
     73  // CONDITION FUNCTIONS and STUFF
     74  void* subject;             //!< The Subject the Condition should act upon.
     75  int (TrackElement::*condFunc)(void*); //!< Pointer to the condition function
     76
     77  int lowest(void* nothing);
     78  int highest(void* nothing);
     79  int random(void* nothing);
     80
     81  int leftRight(void* node);
     82  int nearest(void* node);
     83  // todo  int enemyKilled(void* entity);
     84
     85 private:
     86  char* name;                //!< A name for the Trac.
     87 
    6188};
    6289
    63 
     90//! the Condition to choose between the different ways of the game.
     91enum CONDITION {LOWEST, HIGHEST, RANDOM, LEFTRIGHT, NEAREST, ENEMYKILLED};
    6492
    6593//! The TrackManager handles the flow of the Players through the game.
     
    103131  TrackManager(void);
    104132
    105   static TrackManager* singletonRef;  //!< There may only be one TrackManager existing.
     133  static TrackManager* singletonRef;  //!< There may only be one TrackManager.
     134
    106135  TrackElement* firstTrackElem;       //!< The first TrackElement that exists.
    107136  TrackElement* currentTrackElem;     //!< The TrackElement we are working on.
     137  CurveType curveType;                //!< The CurveType the entire TrackSystem will have.
    108138  float localTime;                    //!< The time that has been passed since the traveling the Track.
    109139  float maxTime;                      //!< The maximal time the track has.
    110140  int trackElemCount;                 //!< The count of TrackElements that exist.
    111   PNode* bindSlave;
     141  PNode* bindSlave;                   //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
     142  PNode* trackNode;                   //!< The main TrackNode of this Track.
    112143 
    113144  void initChildren(unsigned int childCount, SubString* names = NULL);
     
    117148 
    118149 public:
    119   ~TrackManager(void);
     150  virtual ~TrackManager(void);
     151
    120152  static TrackManager* getInstance(void);
    121153
    122154  // Methods to change the Path (initialisation)
    123155  void workOn(unsigned int trackID);
    124   inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);}
     156  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
     157  inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);};
    125158  void setCurveType(CurveType curveType, TrackElement* trackElem);
    126159  void setDuration(float time);
     
    131164  void fork(unsigned int count, ...);
    132165  void forkV(unsigned int count, int* trackIDs, SubString* names = NULL);
    133   void condition(unsigned int groupID, PathCondition cond); //!< \todo really do this!!
     166  void condition(CONDITION cond, void* subject);
     167  void condition(unsigned int groupID, CONDITION cond, void* subject);
    134168  void join(unsigned int count, ...);
    135169  void joinV(unsigned int count, int* trackIDs);
     
    143177
    144178  // Methods to calculate the position on the Path (runtime)
    145   Vector calcPos(void) const;
    146   Vector calcDir(void) const;
     179  inline Vector calcPos(void) const;
     180  inline Vector calcDir(void) const;
     181  float getWidth(void) const;
    147182  void tick(float dt);
    148183  void jumpTo(float time);
    149   void choosePath(int graphID);
     184  inline int choosePath(TrackElement* trackElem);
    150185
    151186  void setBindSlave(PNode* bindSlave);
     187  PNode* getTrackNode(void);
    152188
    153189  // DEBUG //
Note: See TracChangeset for help on using the changeset viewer.