Index: trunk/src/lib/coord/p_node.h
===================================================================
--- trunk/src/lib/coord/p_node.h	(revision 6075)
+++ trunk/src/lib/coord/p_node.h	(revision 6078)
@@ -43,6 +43,7 @@
 
   // REPARENTING
-  PNODE_REPARENT_TO_NULLPARENT         = 0x0010,    //!< Reparents to the NullParent, if the Parent is Removed.
+  PNODE_REPARENT_TO_NULL               = 0x0010,    //!< Reparents to the Null, if the Parent is Removed. Meaning the Node wont have a parent anymore.
   PNODE_REPARENT_TO_PARENTS_PARENT     = 0x0020,    //!< Reparents the Node to the parents (old) parent it the parent gets removed.
+  /////////////////////////////////////////////     //  ELSE: Reparents to the NullParent.
   PNODE_REPARENT_DELETE_CHILDREN       = 0x0040,    //!< Deletes the Children of the node when This Node is Removed. (Use with care).
   /// FIXME
@@ -54,4 +55,5 @@
   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
   PNODE_REPARENT_CHILDREN_ON_REMOVE    = 0x0400,    //!< Reparents the Children of the Node if the Node gets Removed.
+  PNODE_REPARENT_ON_PARENTS_REMOVE     = 0x0800,    //!< The Node gets Reparented if its Parent gets removed. Child will be reparented according to the Reparenting-Rules.
 
   // VISIBILITY/ACTIVITY
@@ -65,5 +67,4 @@
 //! The default mode of the translation-binding.
 #define PNODE_PARENT_MODE_DEFAULT PNODE_ALL | \
-                                  PNODE_REPARENT_CHILDREN_ON_REMOVE | \
                                   PNODE_REPARENT_KEEP_POSITION
 
@@ -72,13 +73,15 @@
 class PNode : virtual public BaseObject {
  public:
-  PNode (PNode* parent = PNode::getNullParent());
+  PNode (PNode* parent = PNode::getNullParent(), long nodeFlags = PNODE_PARENT_MODE_DEFAULT);
   virtual ~PNode ();
 
   void loadParams(const TiXmlElement* root);
 
+  // ACTIVATION //
   inline void activateNode() { this->bActive = true; };
   inline void deactivateNode() { this->bActive = false; };
   inline bool getNodeActiveState() { return this->bActive; };
 
+  // POSITION //
   void setRelCoor (const Vector& relCoord);
   void setRelCoor (float x, float y, float z);
@@ -98,4 +101,12 @@
   void shiftCoor (float x, float y, float z) { this->shiftCoor(Vector(x, y, z)); };
 
+  // SPEED //
+  /** @returns the Speed of the Node */
+  inline float getSpeed() const { return this->velocity.len(); };
+  /** @returns the Velocity of the Node */
+  inline const Vector& getVelocity() const { return this->velocity; };
+
+
+  // ROTATION //
   void setRelDir (const Quaternion& relDir);
   void setRelDir (float x, float y, float z);
@@ -124,10 +135,6 @@
   inline Vector getAbsDirZ() const { return this->absDirection.apply(Vector(0,0,1)); };
 
-  /** @returns the Speed of the Node */
-  inline float getSpeed() const { return this->velocity.len(); };
-  /** @returns the Velocity of the Node */
-  inline const Vector& getVelocity() const { return this->velocity; };
-
-
+
+  // PARENTING //
   void addChild (PNode* child);
   void addChild (const char* childName);
@@ -146,4 +153,5 @@
   void setParentSoft(const char* parentName, float bias = 1.0);
 
+  // PARENTING_MODE AND OTHER FLAGS //
   void setParentMode (PARENT_MODE parentMode);
   void setParentMode (const char* parentingMode);
@@ -151,18 +159,20 @@
   int getParentMode() const { return 0x000f & this->parentMode; };
 
-  void addNodeModeFlags(unsigned short nodeFlags);
-  void removeNodeModeFlags(unsigned short nodeFlags);
-
+  void addNodeFlags(unsigned short nodeFlags);
+  void removeNodeFlags(unsigned short nodeFlags);
+
+  // NULL_PARENT //
   /** @returns the NullParent, the (main) ROOT of the PNode Tree. If it does not yet exist, it will be created. */
-  static PNode* getNullParent()  { return (PNode::nullParent != NULL || (PNode::nullParent = new PNode(NULL)) != NULL)? PNode::nullParent : NULL; };
-
+  static PNode* getNullParent()  { return (PNode::nullParent != NULL)? PNode::nullParent : PNode::createNullParent(); };
+
+  // UPDATING //
   void updateNode (float dt);
 
+  // DEBUG //
   void countChildNodes(int& nodes) const;
   void debugNode (unsigned int depth = 1, unsigned int level = 0) const;
   void debugDraw(unsigned int depth = 1, float size = 1.0, const Vector& color = Vector(1, 0, 0), unsigned int level = 0) const;
 
-
-  // helper functions //
+  // HELPER_FUNCTIONS //
   static const char* parentingModeToChar(int parentingMode);
   static PARENT_MODE charToParentingMode(const char* parentingMode);
@@ -170,5 +180,4 @@
 
  private:
-  void init();
   /** tells the child that the parent's Coordinate has changed */
   inline void parentCoorChanged () { this->bRelCoorChanged = true; }
@@ -178,6 +187,8 @@
   inline Vector getLastAbsCoor() { return this->lastAbsCoordinate; }
 
+  static PNode* createNullParent();
   void reparent();
   bool checkIntegrity(const PNode* checkParent) const;
+  void eraseChild(PNode* child);
 
  private:
