Changeset 6042 in orxonox.OLD for trunk/src/lib/coord
- Timestamp:
- Dec 11, 2005, 4:26:55 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.h
r5915 r6042 1 1 /*! 2 2 * @file p_node.h 3 * @brief Definition of a parenting node3 * @brief Definition of THE Parenting Node 4 4 * 5 5 * parenting is how coordinates are handled in orxonox, meaning, that all coordinates … … 10 10 * absCoordinate, absDirection have to be recalculated as soon as there was a change in 11 11 * place or ortientation. this is only the case if 12 * o b DirChanged is true (so changed) AND timeStamp != now13 * o b CoorChanged is true (so moved) AND timeStamp != now12 * o bRelCoorChanged is true (so moved) 13 * o bRelDirChanged is true (so changed) 14 14 * this conditions make it cheaper to recalculate the tree (reduces redundant work). 15 15 */ … … 20 20 21 21 #include "base_object.h" 22 22 23 #include "vector.h" 23 24 #include <list> … … 25 26 // FORWARD DECLARATION 26 27 class TiXmlElement; 27 template<class T> class tList;28 28 29 29 #define PNODE_ITERATION_DELTA .001 … … 32 32 { 33 33 // PARENTAL FOLLOWING 34 PNODE_LOCAL_ROTATE = 0x000 00001, //!< Rotates all the children around their centers.35 PNODE_ROTATE_MOVEMENT = 0x000 00002, //!< Moves all the children around the center of their parent, without the rotation around their own centers.34 PNODE_LOCAL_ROTATE = 0x0001, //!< Rotates all the children around their centers. 35 PNODE_ROTATE_MOVEMENT = 0x0002, //!< Moves all the children around the center of their parent, without the rotation around their own centers. 36 36 37 PNODE_MOVEMENT = 0x000 00004, //!< Moves all children along with the parent.38 // special linkage modes39 PNODE_ALL = 0x000 00003, //!< Moves all children around the center of their parent, and also rotates their centers40 PNODE_ROTATE_AND_MOVE = 0x000 00005, //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.37 PNODE_MOVEMENT = 0x0004, //!< Moves all children along with the parent. 38 // special linkage modes 39 PNODE_ALL = 0x0003, //!< Moves all children around the center of their parent, and also rotates their centers 40 PNODE_ROTATE_AND_MOVE = 0x0005, //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent. 41 41 42 42 43 PNODE_INACTIVE_NODE = 0x00000010, //!< If the node is Active (if not, it and its child wont be updated).44 45 43 // REPARENTING 46 PNODE_REPARENT_TO_NULLPARENT = 0x00000100, 47 PNODE_REPARENT_KEEP_POSITION = 0x00000200, 44 PNODE_REPARENT_TO_NULLPARENT = 0x0010, //!< Reparents to the NullParent, if the Parent is Removed. 45 PNODE_REPARENT_TO_PARANTS_PARENT = 0x0020, //!< Reparents the Node to the parents (old) parent it the parent gets removed. 46 PNODE_REPARENT_DELETE_CHILDREN = 0x0040, //!< Deletes the Children of the node when This Node is Removed. (Use with care). 47 PNODE_REPARENT_KEEP_POSITION = 0x0080, //!< Tries to keep the Position if the Node is reparented. 48 48 49 49 50 50 // DELETION 51 PNODE_PROHIBIT_CHILD_DELETE = 0x00010000, 52 PNODE_PROHIBIT_DELETE_WITH_PARENT = 0x00020000, 51 PNODE_PROHIBIT_CHILD_DELETE = 0x0100, //!< Prohibits the Children from being deleted if this Node gets deleted. 52 PNODE_PROHIBIT_DELETE_WITH_PARENT = 0x0200, //!< Prohibits the Node to be deleted if the Parent is. Child will be reparented according to the Repaenting-Rules 53 PNODE_REPARENT_CHILDREN_ON_DELETE = 0x0400, //!< Reparents the Children of the Node to 54 PNODE_REPARANT_CHILDREN_ON_REMOVE = 0x0800, //!< Reparents the Children of the Node if the Node gets Removed. 55 56 // VISIBILITY/ACTIVITY 57 PNODE_HIDE_CHILDREN_IF_HIDDEN = 0x1000, //!< Prohibits the Children from being drawn if this node isn't visible. (used for Draw)) 58 PNODE_HIDE_IF_PARENT_HIDDEN = 0x2000, //!< Prohibits the node from being drawn if the Parent is invisible. 59 PNODE_UPDATE_CHILDREN_IF_INACTIVE = 0x4000, //!< Updates the Children of this Node even if the Parent is Inactive (note if this's parent is inactive children won't be updated.) 60 PNODE_STATIC_NODE = 0x8000, //!< Used for nodes that do not have any moving children, and that do not move. 53 61 54 62 } PARENT_MODE; 55 63 56 64 //! The default mode of the translation-binding. 57 #define PNODE_PARENT_MODE_DEFAULT PNODE_ALL | PNODE_REPARENT_KEEP_POSITION 65 #define PNODE_PARENT_MODE_DEFAULT PNODE_ALL | \ 66 PNODE_REPARENT_KEEP_POSITION 58 67 59 68 … … 181 190 float bias; //!< how fast to iterate to the given position (default is 1) 182 191 183 PNode* parent; //!< a pointer to the parent node 184 std::list<PNode*> children; //!< list of the children of this PNode 192 PNode* parent; //!< a pointer to the parent node. 193 std::list<PNode*> children; //!< list of the children of this PNode. 185 194 186 unsigned int parentMode; //!< the mode of the binding 195 bool bActive; //!< If the Node is Active (for cutting off the rest of the tree in update). 196 unsigned short parentMode; //!< the mode of the binding 187 197 }; 188 198 189 199 #endif /* _P_NODE_H */ 190
Note: See TracChangeset
for help on using the changeset viewer.