Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6042 in orxonox.OLD for trunk/src/lib/coord


Ignore:
Timestamp:
Dec 11, 2005, 4:26:55 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new Definitions for PNodes reparenting structure

File:
1 edited

Legend:

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

    r5915 r6042  
    11/*!
    22 * @file p_node.h
    3  * @brief  Definition of a parenting node
     3 * @brief Definition of THE Parenting Node
    44 *
    55 *  parenting is how coordinates are handled in orxonox, meaning, that all coordinates
     
    1010 *  absCoordinate, absDirection have to be recalculated as soon as there was a change in
    1111 *  place or ortientation. this is only the case if
    12  *  o bDirChanged is true (so changed) AND timeStamp != now
    13  *  o bCoorChanged is true (so moved) AND timeStamp != now
     12 *  o bRelCoorChanged is true (so moved)
     13 *  o bRelDirChanged is true (so changed)
    1414 *  this conditions make it cheaper to recalculate the tree (reduces redundant work).
    1515 */
     
    2020
    2121#include "base_object.h"
     22
    2223#include "vector.h"
    2324#include <list>
     
    2526// FORWARD DECLARATION
    2627class TiXmlElement;
    27 template<class T> class tList;
    2828
    2929#define PNODE_ITERATION_DELTA    .001
     
    3232{
    3333  // PARENTAL FOLLOWING
    34   PNODE_LOCAL_ROTATE                   = 0x00000001,    //!< Rotates all the children around their centers.
    35   PNODE_ROTATE_MOVEMENT                = 0x00000002,    //!< 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.
    3636
    37   PNODE_MOVEMENT                       = 0x00000004,    //!< Moves all children along with the parent.
    38 // special linkage modes
    39   PNODE_ALL                            = 0x00000003,    //!< Moves all children around the center of their parent, and also rotates their centers
    40   PNODE_ROTATE_AND_MOVE                = 0x00000005,    //!< 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.
    4141
    4242
    43   PNODE_INACTIVE_NODE                  = 0x00000010,    //!< If the node is Active (if not, it and its child wont be updated).
    44 
    4543  // 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.
    4848
    4949
    5050  // 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.
    5361
    5462} PARENT_MODE;
    5563
    5664//! 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
    5867
    5968
     
    181190  float              bias;               //!< how fast to iterate to the given position (default is 1)
    182191
    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.
    185194
    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
    187197};
    188198
    189199#endif /* _P_NODE_H */
    190 
Note: See TracChangeset for help on using the changeset viewer.