Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4993 in orxonox.OLD for orxonox/trunk/src/lib/coord/p_node.h


Ignore:
Timestamp:
Aug 13, 2005, 11:56:31 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: reimplemented a greate part of PNode, so now it uses only relCoord/relDir to calculate the absolute direction
calling setAbsDir will invoke setRelDir in the process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/coord/p_node.h

    r4992 r4993  
    11/*!
    2     \file p_node.h
     2    @file p_node.h
    33  *  Definition of a parenting node
    44
     
    5555  PNode ();
    5656  PNode(const TiXmlElement* root);
    57   PNode (const Vector& absCoordinate, PNode* pNode);
     57  PNode (const Vector& absCoor, PNode* pNode);
    5858  virtual ~PNode ();
    5959
     
    8989
    9090  /** @returns the Speed of the Node */
    91   inline float getSpeed() const {return this->velocity.len();}
     91  inline float getSpeed() const { return this->velocity.len(); };
    9292  /** @returns the Velocity of the Node */
    93   inline const Vector& getVelocity() const {return this->velocity;}
     93  inline const Vector& getVelocity() const { return this->velocity; };
    9494
    9595
    96   void addChild (PNode* pNode, int parentingMode = DEFAULT_MODE);
     96  void addChild (PNode* child, int parentingMode = DEFAULT_MODE);
    9797  void addChild (const char* childName);
    98   void removeChild (PNode* pNode);
     98  void removeChild (PNode* child);
    9999  void remove();
    100100
     
    107107  void softReparent(const char* parentName, float bias = 1.0);
    108108
    109   void setParentMode (PARENT_MODE parentMode);
     109  /** @param parentMode sets the parentingMode of this Node */
     110  void setParentMode (PARENT_MODE parentMode) { this->parentMode = parentMode; };
    110111  void setParentMode (const char* parentingMode);
    111112  /** @returns the Parenting mode of this node */
     
    117118  void debugDraw(float size = 1.0) const;
    118119
     120
     121  // helper functions //
     122  static const char* parentingModeToChar(int parentingMode);
     123  static PARENT_MODE charToParentingMode(const char* parentingMode);
    119124 private:
    120125  void init(PNode* parent);
     
    124129  inline void parentDirChanged () { this->bRelDirChanged = true; }
    125130  /** @returns the last calculated coordinate */
    126   inline Vector getLastAbsCoor() {return this->lastAbsCoordinate;}
     131  inline Vector getLastAbsCoor() { return this->lastAbsCoordinate; }
    127132
    128133
    129134 private:
    130   bool            bAbsCoorChanged;    //!< If Absolute Coordinate has changed since last time we checked
    131135  bool            bRelCoorChanged;    //!< If Relative Coordinate has changed since last time we checked
    132   bool            bAbsDirChanged;     //!< If Absolute Direction has changed since last time we checked
    133136  bool            bRelDirChanged;     //!< If Relative Direction has changed since last time we checked
    134137
     
    142145
    143146
    144   Vector*         toPosition;         //!< a position to which to iterate. (This is used in conjunction with softReparent.and set*CoorSoft)
     147  Vector*         toCoordinate;       //!< a position to which to iterate. (This is used in conjunction with softReparent.and set*CoorSoft)
    145148  Quaternion*     toDirection;        //!< a direction to which to iterate. (This is used in conjunction with softReparent and set*DirSoft)
    146149  float           bias;               //!< how fast to iterate to the given position (default is 1)
Note: See TracChangeset for help on using the changeset viewer.