Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 11, 2005, 6:23:42 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: multiple new Reparenting modes in PNode.
Testing the stuff in GuidedMissile
Projectile has a PNode as reference not as pointer
some minor weapon changes

File:
1 edited

Legend:

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

    r6048 r6054  
    2828
    2929#define PNODE_ITERATION_DELTA    .001
     30
    3031//! Parental linkage modes
    3132typedef enum
     
    4546  PNODE_REPARENT_TO_PARENTS_PARENT     = 0x0020,    //!< Reparents the Node to the parents (old) parent it the parent gets removed.
    4647  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  /// FIXME
     49   PNODE_REPARENT_KEEP_POSITION         = 0x0080,    //!< Tries to keep the Position if the Node is reparented.
    4850
    4951
     
    5153  PNODE_PROHIBIT_CHILD_DELETE          = 0x0100,    //!< Prohibits the Children from being deleted if this Node gets deleted.
    5254  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  PNODE_REPARENT_CHILDREN_ON_REMOVE    = 0x0400,    //!< Reparents the Children of the Node if the Node gets Removed.
    5556
    5657  // VISIBILITY/ACTIVITY
     
    6465//! The default mode of the translation-binding.
    6566#define PNODE_PARENT_MODE_DEFAULT PNODE_ALL | \
     67                                  PNODE_REPARENT_CHILDREN_ON_REMOVE | \
    6668                                  PNODE_REPARENT_KEEP_POSITION
    6769
     
    7779
    7880  void loadParams(const TiXmlElement* root);
     81
     82  inline void activateNode() { this->bActive = true; };
     83  inline void deactivateNode() { this->bActive = false; };
     84  inline bool getNodeActiveState() { return this->bActive; };
    7985
    8086  void setRelCoor (const Vector& relCoord);
     
    132138  void removeNode();
    133139
    134   /** @param the new parent of this node */
     140  /** @param parent the new parent of this node */
    135141  inline void setParent (PNode* parent) { parent->addChild(this); };
    136142  void setParent (const char* parentName);
     
    143149  void setParentSoft(const char* parentName, float bias = 1.0);
    144150
    145   /** @param parentMode sets the parentingMode of this Node */
    146   void setParentMode (PARENT_MODE parentMode) { this->parentMode = parentMode; };
     151  void setParentMode (PARENT_MODE parentMode);
    147152  void setParentMode (const char* parentingMode);
    148153  /** @returns the Parenting mode of this node */
    149   int getParentMode() const { return this->parentMode; };
     154  int getParentMode() const { return 0x000f & this->parentMode; };
     155
     156  void addNodeModeFlags(unsigned short nodeFlags);
     157  void removeNodeModeFlags(unsigned short nodeFlags);
     158
    150159
    151160  void updateNode (float dt);
Note: See TracChangeset for help on using the changeset viewer.