Changeset 3365 in orxonox.OLD for orxonox/trunk/src/p_node.h
- Timestamp:
- Jan 7, 2005, 1:14:33 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/p_node.h
r3246 r3365 14 14 this conditions make it cheaper to recalculate the tree (reduces redundant work). 15 15 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... 18 18 */ 19 19 … … 24 24 #include "stdincl.h" 25 25 26 class PNode; /* forward decleration, so that parentEntry has access to PNode */ 26 27 27 class PNode { 28 typedef enum parentingMode {MOVEMENT = 0, ROTATION, ALL}; 29 #define DEFAULT_MODE ALL 30 31 class PNode : public BaseObject { 28 32 29 33 public: 30 34 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; 32 44 33 45 Vector getRelCoor (); 34 void setRelCoor (Vector relCoord); 46 void setRelCoor (Vector* relCoord); 47 //void setRelCoor (Vector relCoord); 35 48 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); 37 53 38 54 Quaternion getRelDir (); 39 void setRelDir (Quaternion relDir);55 void setRelDir (Quaternion* relDir); 40 56 Quaternion getAbsDir (); 41 void setAbsCoor (Quaternion absDir); 57 void setAbsDir (Quaternion* absDir); 58 void shiftDir (Quaternion* shift); 42 59 43 60 void addChild (PNode* pNode); 61 void addChild (PNode* pNode, parentingMode mode); 44 62 void removeChild (PNode* pNode); 63 void setParent (PNode* parent); 64 void parentCoorChanged (); 65 void parentDirChanged (); 66 void setMode (parentingMode mode); 45 67 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; 50 84 51 85 Vector relCoordinate; //! coordinates relative to the parent … … 54 88 Quaternion absDirection; //! absolute direvtion in the world ( from (0,0,1) ) 55 89 56 tList<PNode>* children; //! list of the children57 58 90 }; 59 91
Note: See TracChangeset
for help on using the changeset viewer.