Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3365 in orxonox.OLD for orxonox/trunk/src/p_node.h


Ignore:
Timestamp:
Jan 7, 2005, 1:14:33 AM (21 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches/parenting back to the.
merged with command:
svn merge branches/parenting trunk -r 3247:HEAD
resolved all conflicts in favor of parenting.

File:
1 edited

Legend:

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

    r3246 r3365  
    1414    this conditions make it cheaper to recalculate the tree (reduces redundant work).
    1515
    16     remember: if you have to change the coordinates, because the object (point) did move,
    17     don't forget to reset both relCoor and absCoor (offset is the same)
     16    remember: if you have to change the coordinates or the directions, use the functions
     17    that are defined to execute this operation - otherwhise there will be big problems...
    1818*/
    1919
     
    2424#include "stdincl.h"
    2525
     26class PNode; /* forward decleration, so that parentEntry has access to PNode */
    2627
    27 class PNode {
     28typedef enum parentingMode {MOVEMENT = 0, ROTATION, ALL};
     29#define DEFAULT_MODE ALL
     30
     31class PNode : public BaseObject {
    2832
    2933 public:
    3034  PNode ();
    31   ~PNode ();
     35  PNode (Vector* absCoordinate, PNode* pNode);
     36  virtual ~PNode ();
     37
     38  void destroy ();
     39
     40  PNode* parent; //! a pointer to the parent node
     41  tList<PNode>* children; //! list of the children
     42
     43  parentingMode mode;
    3244
    3345  Vector getRelCoor ();
    34   void setRelCoor (Vector relCoord);
     46  void setRelCoor (Vector* relCoord);
     47  //void setRelCoor (Vector relCoord);
    3548  Vector getAbsCoor ();
    36   void setAbsCoor (Vector absCoord);
     49  void setAbsCoor (Vector* absCoord);
     50  //void setAbsCoor (Vector absCoord);
     51  void shiftCoor (Vector* shift);
     52  //void shiftCoor (Vector shift);
    3753
    3854  Quaternion getRelDir ();
    39   void setRelDir (Quaternion relDir);
     55  void setRelDir (Quaternion* relDir);
    4056  Quaternion getAbsDir ();
    41   void setAbsCoor (Quaternion absDir);
     57  void setAbsDir (Quaternion* absDir);
     58  void shiftDir (Quaternion* shift);
    4259
    4360  void addChild (PNode* pNode);
     61  void addChild (PNode* pNode, parentingMode mode);
    4462  void removeChild (PNode* pNode);
     63  void setParent (PNode* parent);
     64  void parentCoorChanged ();
     65  void parentDirChanged ();
     66  void setMode (parentingMode mode);
    4567
    46  private:
    47   long timeStamp; //! this the timeStamp of when the abs{Coordinat, Direction} has been calculated
    48   bool bCoorChanged;
    49   bool bDirChanged;
     68  virtual void update (float timeStamp);
     69  void processTick (float dt);
     70  virtual void tick (float dt);
     71
     72  void setName (char* newName);
     73  char* getName ();
     74
     75
     76  void debug ();
     77
     78  float timeStamp;   //! this the timeStamp of when the abs{Coordinat, Direction} has been calculated
     79  char* objectName;
     80  bool bAbsCoorChanged;
     81  bool bRelCoorChanged;
     82  bool bRelDirChanged;
     83  bool bAbsDirChanged;
    5084
    5185  Vector relCoordinate;  //! coordinates relative to the parent
     
    5488  Quaternion absDirection; //! absolute direvtion in the world ( from (0,0,1) )
    5589
    56   tList<PNode>* children; //! list of the children
    57 
    5890};
    5991
Note: See TracChangeset for help on using the changeset viewer.