Index: /code/branches/presentation/src/orxonox/objects/collisionshapes/CollisionShape.cc
===================================================================
--- /code/branches/presentation/src/orxonox/objects/collisionshapes/CollisionShape.cc	(revision 2526)
+++ /code/branches/presentation/src/orxonox/objects/collisionshapes/CollisionShape.cc	(revision 2527)
@@ -62,5 +62,5 @@
         // Detach from parent
         if (this->isInitialized() && this->parent_)
-            this->parent_->removeChildShape(this);
+            this->parent_->detach(this);
     }
 
@@ -87,5 +87,5 @@
         CompoundCollisionShape* parent = dynamic_cast<CompoundCollisionShape*>(Synchronisable::getSynchronisable(this->parentID_));
         if (parent)
-            parent->addChildShape(this);
+            parent->attach(this);
     }
 
@@ -93,5 +93,5 @@
     {
         if (this->parent_)
-            this->parent_->updateChildShape(this);
+            this->parent_->updateAttachedShape(this);
     }
 
Index: /code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- /code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc	(revision 2526)
+++ /code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc	(revision 2527)
@@ -55,6 +55,6 @@
         {
             // Delete all children
-            for (std::map<CollisionShape*, btCollisionShape*>::iterator it = this->childShapes_.begin();
-                it != this->childShapes_.end(); ++it)
+            for (std::map<CollisionShape*, btCollisionShape*>::iterator it = this->attachedShapes_.begin();
+                it != this->attachedShapes_.end(); ++it)
             {
                 // make sure that the child doesn't want to detach itself --> speedup because of the missing update
@@ -71,5 +71,5 @@
         SUPER(CompoundCollisionShape, XMLPort, xmlelement, mode);
         // Attached collision shapes
-        XMLPortObject(CompoundCollisionShape, CollisionShape, "", addChildShape, getChildShape, xmlelement, mode);
+        XMLPortObject(CompoundCollisionShape, CollisionShape, "", attach, detach, xmlelement, mode);
     }
 
@@ -82,14 +82,14 @@
     }
 
-    void CompoundCollisionShape::addChildShape(CollisionShape* shape)
+    void CompoundCollisionShape::attach(CollisionShape* shape)
     {
         if (!shape || static_cast<CollisionShape*>(this) == shape)
             return;
-        if (this->childShapes_.find(shape) != this->childShapes_.end())
+        if (this->attachedShapes_.find(shape) != this->attachedShapes_.end())
         {
             CCOUT(2) << "Warning: Attaching a CollisionShape twice is not yet supported." << std::endl;
             return;
         }
-        this->childShapes_[shape] = shape->getCollisionShape();
+        this->attachedShapes_[shape] = shape->getCollisionShape();
 
         if (shape->getCollisionShape())
@@ -113,10 +113,10 @@
     }
 
-    void CompoundCollisionShape::removeChildShape(CollisionShape* shape)
-    {
-        if (this->childShapes_.find(shape) != this->childShapes_.end())
+    void CompoundCollisionShape::detach(CollisionShape* shape)
+    {
+        if (this->attachedShapes_.find(shape) != this->attachedShapes_.end())
         {
             shape->setParent(0, OBJECTID_UNKNOWN);
-            this->childShapes_.erase(shape);
+            this->attachedShapes_.erase(shape);
             if (shape->getCollisionShape())
                 this->compoundShape_->removeChildShape(shape->getCollisionShape());
@@ -124,18 +124,20 @@
             this->updatePublicShape();
         }
-    }
-
-    void CompoundCollisionShape::removeAllChildShapes()
-    {
-        while (this->childShapes_.size() > 0)
-            this->removeChildShape(this->childShapes_.begin()->first);
-    }
-
-    void CompoundCollisionShape::updateChildShape(CollisionShape* shape)
+        else
+            CCOUT(2) << "Warning: Cannot detach non child collision shape" << std::endl;
+    }
+
+    void CompoundCollisionShape::detachAll()
+    {
+        while (this->attachedShapes_.size() > 0)
+            this->detach(this->attachedShapes_.begin()->first);
+    }
+
+    void CompoundCollisionShape::updateAttachedShape(CollisionShape* shape)
     {
         if (!shape)
             return;
-        std::map<CollisionShape*, btCollisionShape*>::iterator it = this->childShapes_.find(shape);
-        if (it == this->childShapes_.end())
+        std::map<CollisionShape*, btCollisionShape*>::iterator it = this->attachedShapes_.find(shape);
+        if (it == this->attachedShapes_.end())
         {
             CCOUT(2) << "Warning: Cannot update child shape: Instance not a child." << std::endl;
@@ -162,5 +164,5 @@
         bool bPrimitive = true;
         bool bEmpty = true;
-        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->childShapes_.begin(); it != this->childShapes_.end(); ++it)
+        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); ++it)
         {
             if (it->second)
@@ -198,5 +200,5 @@
     {
         if (this->parent_)
-            this->parent_->updateChildShape(this);
+            this->parent_->updateAttachedShape(this);
         if (this->worldEntityParent_)
             this->worldEntityParent_->notifyCollisionShapeChanged();
@@ -209,8 +211,8 @@
     }
 
-    CollisionShape* CompoundCollisionShape::getChildShape(unsigned int index) const
+    CollisionShape* CompoundCollisionShape::getAttachedShape(unsigned int index) const
     {
         unsigned int i = 0;
-        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->childShapes_.begin(); it != this->childShapes_.end(); ++it)
+        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); ++it)
         {
             if (i == index)
Index: /code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h
===================================================================
--- /code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h	(revision 2526)
+++ /code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h	(revision 2527)
@@ -46,10 +46,10 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            void addChildShape(CollisionShape* shape);
-            void removeChildShape(CollisionShape* shape);
-            void removeAllChildShapes();
-            CollisionShape* getChildShape(unsigned int index) const;
+            void attach(CollisionShape* shape);
+            void detach(CollisionShape* shape);
+            void detachAll();
+            CollisionShape* getAttachedShape(unsigned int index) const;
 
-            void updateChildShape(CollisionShape* shape);
+            void updateAttachedShape(CollisionShape* shape);
 
             void setWorldEntityParent(WorldEntity* parent);
@@ -65,5 +65,5 @@
 
             btCompoundShape* compoundShape_;
-            std::map<CollisionShape*, btCollisionShape*> childShapes_;
+            std::map<CollisionShape*, btCollisionShape*> attachedShapes_;
             WorldEntity* worldEntityParent_;
     };
Index: /code/branches/presentation/src/orxonox/objects/worldentities/Camera.cc
===================================================================
--- /code/branches/presentation/src/orxonox/objects/worldentities/Camera.cc	(revision 2526)
+++ /code/branches/presentation/src/orxonox/objects/worldentities/Camera.cc	(revision 2527)
@@ -109,5 +109,5 @@
             float coeff = min(1.0f, 15.0f * dt);
 
-            Vector3 offset = this->getNode()->getWorldPosition() - this->cameraNode_->getWorldPosition();
+            Vector3 offset = this->getWorldPosition() - this->cameraNode_->getWorldPosition();
             this->cameraNode_->translate(coeff * offset);
 
Index: /code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- /code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2526)
+++ /code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2527)
@@ -71,4 +71,6 @@
         this->physicalBody_ = 0;
         this->bPhysicsActive_ = false;
+        this->bPhysicsActiveSynchronised_ = false;
+        this->bPhysicsActiveBeforeAttaching_ = false;
         this->collisionShape_ = new CompoundCollisionShape(this);
         // Note: CompoundCollisionShape is a Synchronisable, but must not be synchronised.
@@ -251,33 +253,4 @@
     void WorldEntity::attach(WorldEntity* object)
     {
-        // check first whether attaching is even allowed
-        if (object->hasPhysics())
-        {
-            if (!this->hasPhysics())
-            {
-                COUT(2) << "Warning: Cannot attach a physical object to a non physical one." << std::endl;
-                return;
-            }
-            else if (object->isDynamic())
-            {
-                COUT(2) << "Warning: Cannot attach a dynamic object to a WorldEntity." << std::endl;
-                return;
-            }
-            else if (object->isKinematic() && this->isDynamic())
-            {
-                COUT(2) << "Warning: Cannot attach a kinematic object to a dynamic one." << std::endl;
-                return;
-            }
-            else if (object->isKinematic())
-            {
-                COUT(2) << "Warning: Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << std::endl;
-                return;
-            }
-            else
-            {
-                object->deactivatePhysics();
-            }
-        }
-
         if (object == this)
         {
@@ -286,14 +259,10 @@
         }
 
-        if (object->getParent())
-            object->detachFromParent();
+        if (!object->notifyBeingAttached(this))
+            return;
 
         this->attachNode(object->node_);
-
         this->children_.insert(object);
-        object->parent_ = this;
-        object->parentID_ = this->getObjectID();
-
-        // collision shapes
+
         this->attachCollisionShape(object->getCollisionShape());
         // mass
@@ -302,8 +271,60 @@
     }
 
+    bool WorldEntity::notifyBeingAttached(WorldEntity* newParent)
+    {
+        // check first whether attaching is even allowed
+        if (this->hasPhysics())
+        {
+            if (!newParent->hasPhysics())
+            {
+                COUT(2) << "Warning: Cannot attach a physical object to a non physical one." << std::endl;
+                return false;
+            }
+            else if (this->isDynamic())
+            {
+                COUT(2) << "Warning: Cannot attach a dynamic object to a WorldEntity." << std::endl;
+                return false;
+            }
+            else if (this->isKinematic() && newParent->isDynamic())
+            {
+                COUT(2) << "Warning: Cannot attach a kinematic object to a dynamic one." << std::endl;
+                return false;
+            }
+            else if (this->isKinematic())
+            {
+                COUT(2) << "Warning: Cannot attach a kinematic object to a static or kinematic one: Not yet implemented." << std::endl;
+                return false;
+            }
+        }
+
+        if (this->isPhysicsActive())
+            this->bPhysicsActiveBeforeAttaching_ = true;
+        this->deactivatePhysics();
+
+        if (this->parent_)
+            this->detachFromParent();
+
+        this->parent_ = newParent;
+        this->parentID_ = newParent->getObjectID();
+
+        // apply transform to collision shape
+        this->collisionShape_->setPosition(this->getPosition());
+        this->collisionShape_->setOrientation(this->getOrientation());
+        // TODO: Scale
+        
+        return true;
+    }
+
     void WorldEntity::detach(WorldEntity* object)
     {
+        if (this->children_.find(object) == this->children_.end())
+        {
+            CCOUT(2) << "Warning: Cannot detach an object that is not a child." << std::endl;
+            return;
+        }
+
         // collision shapes
         this->detachCollisionShape(object->getCollisionShape());
+
         // mass
         if (object->getMass() > 0.0f)
@@ -315,9 +336,23 @@
         this->detachNode(object->node_);
         this->children_.erase(object);
-        object->parent_ = 0;
-        object->parentID_ = OBJECTID_UNKNOWN;
-
-        // Note: It is possible that the object has physics but was disabled when attaching
-        object->activatePhysics();
+
+        object->notifyDetached();
+    }
+
+    void WorldEntity::notifyDetached()
+    {
+        this->parent_ = 0;
+        this->parentID_ = OBJECTID_UNKNOWN;
+
+        // reset orientation of the collisionShape (cannot be set within a WE usually)
+        this->collisionShape_->setPosition(Vector3::ZERO);
+        this->collisionShape_->setOrientation(Quaternion::IDENTITY);
+        // TODO: Scale
+
+        if (this->bPhysicsActiveBeforeAttaching_)
+        {
+            this->activatePhysics();
+            this->bPhysicsActiveBeforeAttaching_ = false;
+        }
     }
 
@@ -351,5 +386,5 @@
     void WorldEntity::attachCollisionShape(CollisionShape* shape)
     {
-        this->collisionShape_->addChildShape(shape);
+        this->collisionShape_->attach(shape);
         // Note: this->collisionShape_ already notifies us of any changes.
     }
@@ -357,5 +392,5 @@
     void WorldEntity::detachCollisionShape(CollisionShape* shape)
     {
-        this->collisionShape_->removeChildShape(shape);
+        this->collisionShape_->detach(shape);
         // Note: this->collisionShape_ already notifies us of any changes.
     }
@@ -363,5 +398,5 @@
     CollisionShape* WorldEntity::getAttachedCollisionShape(unsigned int index) const
     {
-        return this->collisionShape_->getChildShape(index);
+        return this->collisionShape_->getAttachedShape(index);
     }
 
Index: /code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.h
===================================================================
--- /code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2526)
+++ /code/branches/presentation/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2527)
@@ -244,7 +244,7 @@
             CollisionShape* getAttachedCollisionShape(unsigned int index) const;
 
-            inline CompoundCollisionShape* getCollisionShape()
+            inline CompoundCollisionShape* getCollisionShape() const
                 { return this->collisionShape_; }
-            inline btRigidBody* getPhysicalBody()
+            inline btRigidBody* getPhysicalBody() const
                 { return this->physicalBody_; }
 
@@ -259,5 +259,5 @@
             inline void disableCollisionCallback()
                 { this->bCollisionCallbackActive_ = false; this->collisionCallbackActivityChanged(); }
-            inline bool isCollisionCallbackActive()
+            inline bool isCollisionCallbackActive() const
                 { return this->bCollisionCallbackActive_; }
 
@@ -271,4 +271,7 @@
             void recalculateMassProps();
             void resetPhysicsProps();
+
+            bool notifyBeingAttached(WorldEntity* newParent);
+            void notifyDetached();
 
             // network callbacks
@@ -293,4 +296,5 @@
             bool                         bPhysicsActive_;
             bool                         bPhysicsActiveSynchronised_;
+            bool                         bPhysicsActiveBeforeAttaching_;
             CompoundCollisionShape*      collisionShape_;
             btScalar                     mass_;
