Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3517 in orxonox.OLD for orxonox/branches/trackManager/src


Ignore:
Timestamp:
Mar 12, 2005, 12:34:15 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/trackManager: some doxygen-tags.

Location:
orxonox/branches/trackManager/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/trackManager/src/lib/math/curve.cc

    r3498 r3517  
    4646}
    4747
     48/**
     49   \brief adds a new Node to the bezier Curve ath Position insertPosition
     50   \param insertPosition The Position on the Path to insert the node.
     51   \param newNode a Vector to the position of the new node
     52*/
    4853void Curve::addNode(const Vector& newNode, unsigned int insertPosition)
    4954{
     
    253258/**
    254259   \brief Calulates the direction of the Curve at time t.
    255    \param The time at which to evaluate the curve.
    256    \returns The vvaluated Vector.
     260   \param t The time at which to evaluate the curve.
     261   \returns The Directional Vector.
    257262*/
    258263Vector BezierCurve::calcDir (float t)
     
    261266}
    262267
     268/**
     269   \brief Calulates the acceleration of the Curve at time t.
     270   \param t The time at which to evaluate the curve.
     271   \returns The acceleration-Vector.
     272*/
    263273Vector BezierCurve::calcAcc (float t)
    264274{
     
    416426/**
    417427   \brief Calulates the direction of the Curve at time t.
    418    \param The time at which to evaluate the curve.
     428   \param t The time at which to evaluate the curve.
    419429   \returns The vvaluated Vector.
    420430*/
  • orxonox/branches/trackManager/src/lib/math/curve.h

    r3498 r3517  
    1717
    1818//! An abstract class to handle curves. Needed for the Tracking system in orxonox.
     19/**
     20   A Curve is a smooth line which tries to approximate a path through the nodes given to it.
     21   <br>
     22
     23   <b>Usage of Curves:</b><br>
     24   \li Creation: Curve* newCurve = new BezierCurve();
     25   \li Adding some Points: newCurve->addNode([Vector to the point to add]);
     26   \li Get Point on Curve: newCurve->calcPos(timeIndex);    // where timeindex is in the interval [0,1]
     27   <br>
     28   More Fuctionality is:
     29   \li debug():  outputs some info about this curve.
     30   \li getNode(i): returns a Vector to the n'th node of the Curve.
     31   \li getNodeCount(): returns the count of nodes.
     32   <br>
     33   General Info:
     34   \li Curves take rather much power to be created/altered, but are fast calculated at runtime.
     35*/
    1936class Curve
    2037{
     
    3956
    4057 private:
     58  //! rebuilds the Curve with the right algorithm
    4159  virtual void rebuild(void) = 0;
    4260 public:
     
    4563  void addNode(const Vector& newNode, unsigned int insertPosition);
    4664  Vector getNode(unsigned int nodeToFind);
     65  /** \returns the Count of nodes of this Curve */
    4766  inline int getNodeCount(void) { return this->nodeCount;}
    4867
    49   virtual Vector calcPos(float t) = 0;
     68  /**
     69     \brief A virtual function to calculate the Position on the Curve
     70     \returns positionVector
     71     \param t the timeindex on this curve [0,1]f
     72  */
     73  virtual Vector calcPos(float t) = 0;
     74  /**
     75     \brief A virtual function to calculate the Direction of the Curve
     76     \returns directionVector
     77     \param t the timeindex on this curve [0,1]f
     78  */
    5079  virtual Vector calcDir(float t) = 0;
     80  /**
     81     \brief A virtual function to calculate the acceleration on the Curve
     82     \returns accelerationVector
     83     \param t the timeindex on this curve [0,1]f
     84  */
    5185  virtual Vector calcAcc(float t) = 0;
     86  /**
     87     \brief A virtual function to calculate the Quaternion on the Curve
     88     \returns directional Quaternion
     89     \param t the timeindex on this curve [0,1]f
     90  */
    5291  virtual Quaternion calcQuat(float t) = 0;
    5392 
  • orxonox/branches/trackManager/src/track_manager.cc

    r3516 r3517  
    3535  this->isJoined = false;
    3636  this->mainJoin = false;
    37   this->cond; //!< todo think!!
    3837  this->ID = -1;
    3938  this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.
     
    111110}
    112111
     112/**
     113   \brief CONDITION that chooses the first child for the decision (static)
     114   \param nothing Nothing in this function
     115   \returns the chosen child
     116*/
    113117int TrackElement::lowest(void* nothing)
    114118{
     
    116120}
    117121
     122/**
     123   \brief CONDITION that chooses the last child for the decision (static)
     124   \param nothing Nothing in this function
     125   \returns the chosen child
     126*/
    118127int TrackElement::highest(void* nothing)
    119128{
     
    121130}
    122131
     132/**
     133   \brief CONDITION that chooses a random child for the decision (static)
     134   \param nothing Nothing in this function
     135   \returns the chosen child
     136*/
    123137int TrackElement::random(void* nothing)
    124138{
     
    130144}
    131145
    132 
     146/**
     147   \brief CONDITION that chooses child 0, if the node(probably Player)
     148   is left of its parent (z<0)) and 1/right otherwise.
     149   \param node The node to act upon.
     150   \returns the chosen child
     151*/
    133152int TrackElement::leftRight(void* node)
    134153{
     
    142161
    143162
    144 // todo
     163/**
     164   \brief CONDITION that chooses the child, that has the nearest distance to the node (probably player).
     165   \param node The node to act upon.
     166   \returns the chosen child
     167
     168   This is rather dangerous, because one must carefully set the points on the curve.
     169   The best Way is to set the nodes as wide away of each other as possible,
     170   but take into consideration, that if the nodes are to far from a center node, the center will be chosen.
     171   (play with this!!).
     172*/
    145173int TrackElement::nearest(void* node)
    146174{
     
    264292/**
    265293   \brief Sets the Type of the Curve
    266    \brief curveType The Type to set
     294   \param curveType The Type to set
     295   \param trackElem the TrackElement that should get a new Curve.
    267296*/
    268297void TrackManager::setCurveType(CurveType curveType, TrackElement* trackElem)
  • orxonox/branches/trackManager/src/track_manager.h

    r3515 r3517  
    1616
    1717class PNode;
    18 
    19 //! condition for choosing a certain Path. \todo implement a useful way.
    20 struct PathCondition
    21 {
    22  
    23 };
    24  
    2518
    2619//! A Graph-Element, that holds the curve-structure of a Level.
     
    4437  bool isJoined;             //!< If the End of the Curve is joined.
    4538  bool mainJoin;             //!< If the End of the Curve is joined, and this is the one Curve the others join to.
    46   PathCondition cond;        //!< The Split Condition;
    4739  int ID;                    //!< The ID of this TrackElement
    4840  float startingTime;        //!< The time at which this Track begins.
     
    6759  int leftRight(void* node);
    6860  int nearest(void* node);
    69   int enemyKilled(void* entity);
     61  // todo  int enemyKilled(void* entity);
    7062};
    7163
     64//! the Condition to choose between the different ways of the game.
    7265enum CONDITION {LOWEST, HIGHEST, RANDOM, LEFTRIGHT, NEAREST, ENEMYKILLED};
    7366
     
    118111  float maxTime;                      //!< The maximal time the track has.
    119112  int trackElemCount;                 //!< The count of TrackElements that exist.
    120   PNode* bindSlave;
     113  PNode* bindSlave;                   //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
    121114 
    122115  void initChildren(unsigned int childCount);
     
    130123  // Methods to change the Path (initialisation)
    131124  void workOn(unsigned int trackID);
    132   inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);}
     125  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
     126  inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);};
    133127  void setCurveType(CurveType curveType, TrackElement* trackElem);
    134128  void setDuration(float time);
     
    140134  void forkV(unsigned int count, int* trackIDs);
    141135  void condition(CONDITION cond, void* subject);
    142   void condition(unsigned int groupID, CONDITION cond, void* subject); //!< \todo really do this!!
     136  void condition(unsigned int groupID, CONDITION cond, void* subject);
    143137  void join(unsigned int count, ...);
    144138  void joinV(unsigned int count, int* trackIDs);
Note: See TracChangeset for help on using the changeset viewer.