Index: code/branches/physics/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/physics/src/orxonox/OrxonoxPrereqs.h	(revision 2421)
+++ code/branches/physics/src/orxonox/OrxonoxPrereqs.h	(revision 2423)
@@ -212,4 +212,7 @@
 // Bullet Physics Engine
 
+class btTransform;
+class btVector3;
+
 class btRigidBody;
 class btCollisionObject;
Index: code/branches/physics/src/orxonox/OrxonoxStableHeaders.h
===================================================================
--- code/branches/physics/src/orxonox/OrxonoxStableHeaders.h	(revision 2421)
+++ code/branches/physics/src/orxonox/OrxonoxStableHeaders.h	(revision 2423)
@@ -103,5 +103,5 @@
 //#endif /* ifdef NDEBUG */
 
-#endif /* ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && !defined(ORXONOX_DISABLE_PCH) */
+#endif /* defined(ORXONOX_ENABLE_PCH) */
 
 #endif /* _OrxonoxStableHeaders_H__ */
Index: code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc	(revision 2423)
@@ -76,12 +76,18 @@
     void CollisionShape::registerVariables()
     {
-        REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<CollisionShape>(this, &CollisionShape::updateParent));
+        REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged));
+    }
+
+    void CollisionShape::parentChanged()
+    {
+        CompoundCollisionShape* parent = dynamic_cast<CompoundCollisionShape*>(Synchronisable::getSynchronisable(this->parentID_));
+        if (parent)
+            parent->addChildShape(this);
     }
 
     void CollisionShape::updateParent()
     {
-        CompoundCollisionShape* parent = dynamic_cast<CompoundCollisionShape*>(Synchronisable::getSynchronisable(this->parentID_));
-        if (parent)
-            parent->addChildShape(this);
+        if (this->parent_)
+            this->parent_->updateChildShape(this);
     }
 
@@ -95,4 +101,5 @@
     {
         ThrowException(NotImplemented, "Cannot set the scale of a collision shape: Not yet implemented.");
+        this->updateParent();
     }
 
@@ -100,4 +107,13 @@
     {
         ThrowException(NotImplemented, "Cannot set the scale of a collision shape: Not yet implemented.");
+        this->updateParent();
+    }
+
+    btVector3 CollisionShape::getLocalInertia(btScalar mass) const
+    {
+        btVector3 inertia(0, 0, 0);
+        if (this->collisionShape_)
+            this->collisionShape_->calculateLocalInertia(mass, inertia);
+        return inertia;
     }
 }
Index: code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.h
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.h	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.h	(revision 2423)
@@ -32,4 +32,5 @@
 #include "OrxonoxPrereqs.h"
 
+#include "LinearMath/btVector3.h"
 #include "util/Math.h"
 #include "core/BaseObject.h"
@@ -48,16 +49,16 @@
 
             inline void setPosition(const Vector3& position)
-                { this->position_ = position; }
+                { this->position_ = position; this->updateParent(); }
             inline const Vector3& getPosition() const
                 { return this->position_; }
 
             inline void setOrientation(const Quaternion& orientation)
-                { this->orientation_ = orientation; }
+                { this->orientation_ = orientation; this->updateParent(); }
             inline const Quaternion& getOrientation() const
                 { return this->orientation_; }
 
-            void yaw(const Degree& angle)   { this->orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_Y); }
-            void pitch(const Degree& angle) { this->orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_X); }
-            void roll(const Degree& angle)  { this->orientation_ = this->orientation_ * Quaternion(angle, Vector3::UNIT_Z); }
+            void yaw(const Degree& angle)   { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_Y)); }
+            void pitch(const Degree& angle) { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_X)); }
+            void roll(const Degree& angle)  { this->setOrientation(this->orientation_ * Quaternion(angle, Vector3::UNIT_Z)); }
 
             virtual void setScale3D(const Vector3& scale);
@@ -66,5 +67,7 @@
                 { return this->scale_; }
 
-            virtual inline btCollisionShape* getCollisionShape() const
+            btVector3 getLocalInertia(float mass) const;
+
+            inline btCollisionShape* getCollisionShape() const
                 { return this->collisionShape_; }
 
@@ -75,14 +78,16 @@
 
         protected:
-            btCollisionShape* collisionShape_;
+            virtual void updateParent();
+
+            btCollisionShape*       collisionShape_;
+            CompoundCollisionShape* parent_;
 
         private:
-            void updateParent();
+            void parentChanged();
 
-            Vector3           position_;
-            Quaternion        orientation_;
-            Vector3           scale_;
-            CompoundCollisionShape* parent_;
-            unsigned int      parentID_;
+            Vector3                 position_;
+            Quaternion              orientation_;
+            Vector3                 scale_;
+            unsigned int            parentID_;
     };
 }
Index: code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc	(revision 2423)
@@ -32,7 +32,9 @@
 #include "BulletCollision/CollisionShapes/btCompoundShape.h"
 
+#include "util/Exception.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
 #include "tools/BulletConversions.h"
+#include "objects/worldentities/WorldEntity.h"
 
 namespace orxonox
@@ -50,5 +52,9 @@
     {
         if (this->isInitialized())
+        {
+            // Detatch all children first
+            this->removeAllChildShapes();
             delete this->compoundShape_;
+        }
     }
 
@@ -60,21 +66,14 @@
     }
 
-    btCollisionShape* CompoundCollisionShape::getCollisionShape() const
+    void CompoundCollisionShape::addChildShape(CollisionShape* shape)
     {
-        // Note: Returning collisionShape_ means that it's the only one and has no transform.
-        //       So we can get rid of the additional overhead with the compound shape.
-        if (this->collisionShape_)
-            return this->collisionShape_;
-        else if (!this->empty())
-            return this->compoundShape_;
-        else
-            return 0;
-    }
-
-    void CompoundCollisionShape::addChildShape(CollisionShape* shape, bool bWorldEntityRoot)
-    {
-        if (!shape)
+        if (!shape || static_cast<CollisionShape*>(this) == shape)
             return;
-        this->childShapes_.push_back(shape);
+        if (this->childShapes_.find(shape) != this->childShapes_.end())
+        {
+            ThrowException(NotImplemented, "Warning: Attaching a CollisionShape twice is not yet supported.");
+            return;
+        }
+        this->childShapes_[shape] = shape->getCollisionShape();
 
         if (shape->getCollisionShape())
@@ -84,27 +83,110 @@
             this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
 
-            if (this->childShapes_.size() == 1 && !this->childShapes_[0]->hasTransform())
-            {
-                // --> Only shape to be added, no transform; add it directly
-                this->collisionShape_ = shape->getCollisionShape();
-            }
-            else
-            {
-                // Make sure we use the compound shape when returning the btCollisionShape
-                this->collisionShape_ = 0;
-            }
+            this->updatePublicShape();
         }
 
         // network synchro
-        if (!bWorldEntityRoot)
-            shape->setParent(this, this->getObjectID());
+        shape->setParent(this, this->getObjectID());
+    }
+
+    void CompoundCollisionShape::removeChildShape(CollisionShape* shape)
+    {
+        if (this->childShapes_.find(shape) != this->childShapes_.end())
+        {
+            shape->setParent(0, (unsigned int)-1);
+            this->childShapes_.erase(shape);
+            if (shape->getCollisionShape())
+                this->compoundShape_->removeChildShape(shape->getCollisionShape());
+
+            this->updatePublicShape();
+        }
+    }
+
+    void CompoundCollisionShape::removeAllChildShapes()
+    {
+        while (this->childShapes_.size() > 0)
+            this->removeChildShape(this->childShapes_.begin()->first);
+    }
+
+    void CompoundCollisionShape::updateChildShape(CollisionShape* shape)
+    {
+        if (!shape)
+            return;
+        std::map<CollisionShape*, btCollisionShape*>::iterator it = this->childShapes_.find(shape);
+        if (it == this->childShapes_.end())
+        {
+            CCOUT(2) << "Warning: Cannot update child shape: Instance not a child." << std::endl;
+            return;
+        }
+
+        // Remove old btCollisionShape, stored in the children map
+        if (it->second)
+            this->compoundShape_->removeChildShape(it->second);
+        if (shape->getCollisionShape())
+        {
+            // Only actually attach if we didn't pick a CompoundCollisionShape with no content
+            btTransform transf(omni_cast<btQuaternion>(shape->getOrientation()), omni_cast<btVector3>(shape->getPosition()));
+            this->compoundShape_->addChildShape(transf, shape->getCollisionShape());
+            it->second = shape->getCollisionShape();
+        }
+
+        this->updatePublicShape();
+    }
+
+    void CompoundCollisionShape::updatePublicShape()
+    {
+        btCollisionShape* primitive = 0;
+        bool bPrimitive = true;
+        bool bEmpty = true;
+        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->childShapes_.begin(); it != this->childShapes_.end(); ++it)
+        {
+            if (it->second)
+            {
+                bEmpty = false;
+                if (!it->first->hasTransform())
+                    primitive = it->second;
+                else
+                    bPrimitive = false;
+            }
+        }
+        if (bEmpty)
+            this->collisionShape_ = 0;
+        else if (bPrimitive)
+        {
+            // --> Only one shape to be added, no transform; return it directly
+            this->collisionShape_ = primitive;
+        }
+        else
+        {
+            // Make sure we use the compound shape when returning a btCollisionShape
+            this->collisionShape_ = this->compoundShape_;
+        }
+        this->updateParent();
+    }
+
+    void CompoundCollisionShape::updateParent()
+    {
+        if (this->parent_)
+            this->parent_->updateChildShape(this);
+        else
+        {
+            // We can do this, because the CompoundCollisionShape of a WorldEntity always belongs to it,
+            // as long as its lifetime.
+            WorldEntity* parent = dynamic_cast<WorldEntity*>(this->getCreator());
+            if (parent)
+                parent->notifyCollisionShapeChanged();
+        }
     }
 
     CollisionShape* CompoundCollisionShape::getChildShape(unsigned int index) const
     {
-        if (index < this->childShapes_.size())
-            return this->childShapes_[index];
-        else
-            return 0;
+        unsigned int i = 0;
+        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->childShapes_.begin(); it != this->childShapes_.end(); ++it)
+        {
+            if (i == index)
+                return it->first;
+            ++i;
+        }
+        return 0;
     }
 }
Index: code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/CompoundCollisionShape.h	(revision 2423)
@@ -45,15 +45,19 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
-            void addChildShape(CollisionShape* shape, bool bWorldEntityRoot = false);
+            void addChildShape(CollisionShape* shape);
+            void removeChildShape(CollisionShape* shape);
+            void removeAllChildShapes();
             CollisionShape* getChildShape(unsigned int index) const;
 
-            virtual btCollisionShape* getCollisionShape() const;
+            void updateChildShape(CollisionShape* shape);
 
-            inline bool empty() const
-                { return this->childShapes_.size() == 0; }
+        protected:
+            virtual void updateParent();
 
         private:
-            btCompoundShape*             compoundShape_;
-            std::vector<CollisionShape*> childShapes_;
+            void updatePublicShape();
+
+            btCompoundShape* compoundShape_;
+            std::map<CollisionShape*, btCollisionShape*> childShapes_;
     };
 }
Index: code/branches/physics/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc	(revision 2423)
@@ -74,4 +74,5 @@
             delete this->collisionShape_;
         this->collisionShape_ = new btStaticPlaneShape(omni_cast<btVector3>(this->normal_), this->offset_);
+        this->updateParent();
     }
 }
Index: code/branches/physics/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc	(revision 2423)
@@ -72,5 +72,7 @@
         if (this->collisionShape_)
             delete this->collisionShape_;
+        // When we recreate the shape, we have to inform the parent about this to update the shape
         this->collisionShape_ = new btSphereShape(this->radius_);
+        this->updateParent();
     }
 }
Index: code/branches/physics/src/orxonox/objects/worldentities/StaticEntity.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/worldentities/StaticEntity.cc	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/worldentities/StaticEntity.cc	(revision 2423)
@@ -60,5 +60,5 @@
     void StaticEntity::setPosition(const Vector3& position)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -74,5 +74,5 @@
     void StaticEntity::translate(const Vector3& distance, Ogre::Node::TransformSpace relativeTo)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -88,5 +88,5 @@
     void StaticEntity::setOrientation(const Quaternion& orientation)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -102,5 +102,5 @@
     void StaticEntity::rotate(const Quaternion& rotation, Ogre::Node::TransformSpace relativeTo)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -117,5 +117,5 @@
     void StaticEntity::yaw(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -133,5 +133,5 @@
     void StaticEntity::pitch(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -149,5 +149,5 @@
     void StaticEntity::roll(const Degree& angle, Ogre::Node::TransformSpace relativeTo)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -165,5 +165,5 @@
     void StaticEntity::lookAt(const Vector3& target, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
@@ -179,5 +179,5 @@
     void StaticEntity::setDirection(const Vector3& direction, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector)
     {
-        if (this->isPhysicsRunning())
+        if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Cannot change position or orientation of a StaticEntity with physics at run time.");
         if (this->isStatic())
Index: code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2423)
@@ -33,7 +33,4 @@
 #include <cassert>
 #include <OgreSceneManager.h>
-
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
 #include "BulletDynamics/Dynamics/btRigidBody.h"
 
@@ -44,5 +41,4 @@
 
 #include "objects/Scene.h"
-#include "objects/collisionshapes/CollisionShape.h"
 #include "objects/collisionshapes/CompoundCollisionShape.h"
 
@@ -73,7 +69,8 @@
         // Default behaviour does not include physics
         this->physicalBody_ = 0;
+        this->bPhysicsActive_ = false;
         this->collisionShape_ = new CompoundCollisionShape(this);
         this->mass_ = 0;
-        this->childMass_ = 0;
+        this->childrenMass_ = 0;
         this->collisionType_ = None;
         this->collisionTypeSynchronised_ = None;
@@ -90,11 +87,12 @@
                 this->getScene()->getSceneManager()->destroySceneNode(this->node_->getName());
 
+            // TODO: Detach from parent and detach all children.
+
             if (this->physicalBody_)
             {
-                if (this->physicalBody_->isInWorld())
-                    this->getScene()->getPhysicalWorld()->removeRigidBody(this->physicalBody_);
+                this->deactivatePhysics();
                 delete this->physicalBody_;
             }
-            // TODO: Delete collisionShapes
+            delete this->collisionShape_;
         }
     }
@@ -129,12 +127,13 @@
         REGISTERDATA(this->bVisible_,    network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
 
-        // HACK: Removed the call because it gets called the first time as well
-        REGISTERDATA(this->getScale3D(), network::direction::toclient);//, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
-
-        int* collisionType = (int*)&this->collisionTypeSynchronised_;
-        REGISTERDATA(*collisionType, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));
-        REGISTERDATA(this->mass_,    network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));
-
-        REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
+        REGISTERDATA(this->getScale3D(), network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
+
+        REGISTERDATA((int&)this->collisionTypeSynchronised_,
+                                         network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));
+        REGISTERDATA(this->mass_,        network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));
+        REGISTERDATA(this->bPhysicsActiveSynchronised_,
+                                         network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));
+
+        REGISTERDATA(this->parentID_,    network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::updateParent));
     }
 
@@ -167,4 +166,12 @@
     {
         this->setMass(this->mass_);
+    }
+
+    void WorldEntity::physicsActivityChanged()
+    {
+        if (this->bPhysicsActiveSynchronised_)
+            this->activatePhysics();
+        else
+            this->deactivatePhysics();
     }
 
@@ -184,17 +191,5 @@
             else
             {
-                if (this->physicalBody_->isInWorld())
-                    removeFromPhysicalWorld();
-                if (object->physicalBody_->isInWorld())
-                    this->getScene()->removeRigidBody(object->physicalBody_);
-
-                // static to static/kinematic/dynamic --> merge shapes
-                this->childMass_ += object->getMass();
-                this->attachCollisionShape(object->getCollisionShape(), true);
-                // Remove the btRigidBody from the child object.
-                // That also implies that cannot add a physics WE to the child afterwards.
-                object->setCollisionType(None);
-
-                addToPhysicalWorld();
+                object->deactivatePhysics();
             }
         }
@@ -213,14 +208,31 @@
         object->parent_ = this;
         object->parentID_ = this->getObjectID();
+
+        // collision shapes
+        this->attachCollisionShape(object->getCollisionShape());
+        // mass
+        this->childrenMass_ += object->getMass();
+        recalculatePhysicsProps();
     }
 
     void WorldEntity::detach(WorldEntity* object)
     {
+        // collision shapes
+        this->detachCollisionShape(object->getCollisionShape());
+        // mass
+        if (object->getMass() > 0.0f)
+        {
+            this->childrenMass_ -= object->getMass();
+            recalculatePhysicsProps();
+        }
+
         this->node_->removeChild(object->node_);
         this->children_.erase(object);
         object->parent_ = 0;
         object->parentID_ = (unsigned int)-1;
-
 //        this->getScene()->getRootSceneNode()->addChild(object->node_);
+
+        // Note: It is possible that the object has physics but was disabled when attaching
+        object->activatePhysics();
     }
 
@@ -237,21 +249,14 @@
     }
 
-    void WorldEntity::attachCollisionShape(CollisionShape* shape, bool bWorldEntityRoot)
-    {
-        this->collisionShape_->addChildShape(shape, bWorldEntityRoot);
-
-        if (this->physicalBody_)
-        {
-            if (this->physicalBody_->isInWorld())
-            {
-                COUT(2) << "Warning: Attaching collision shapes at run time causes its physical body to be removed and added again.";
-                removeFromPhysicalWorld();
-            }
-            if (this->collisionShape_->getCollisionShape())
-                this->physicalBody_->setCollisionShape(this->collisionShape_->getCollisionShape());
-            // recalculate inertia tensor
-            internalSetMassProps();
-            addToPhysicalWorld();
-        }
+    void WorldEntity::attachCollisionShape(CollisionShape* shape)
+    {
+        this->collisionShape_->addChildShape(shape);
+        // Note: this->collisionShape_ already notifies us of any changes.
+    }
+
+    void WorldEntity::detachCollisionShape(CollisionShape* shape)
+    {
+        this->collisionShape_->removeChildShape(shape);
+        // Note: this->collisionShape_ already notifies us of any changes.
     }
 
@@ -261,14 +266,25 @@
     }
 
-    void WorldEntity::addToPhysicalWorld() const
-    {
-        if (this->isActive() && this->hasPhysics() && !this->physicalBody_->isInWorld())
+    void WorldEntity::activatePhysics()
+    {
+        if (this->isActive() && this->hasPhysics() && !this->isPhysicsActive() && !this->parent_)
+        {
             this->getScene()->addRigidBody(this->physicalBody_);
-    }
-
-    void WorldEntity::removeFromPhysicalWorld() const
-    {
-        if (this->hasPhysics())
+            this->bPhysicsActive_ = true;
+        }
+    }
+
+    void WorldEntity::deactivatePhysics()
+    {
+        if (this->isPhysicsActive())
+        {
             this->getScene()->removeRigidBody(this->physicalBody_);
+            this->bPhysicsActive_ = false;
+        }
+    }
+
+    bool WorldEntity::addedToPhysicalWorld() const
+    {
+        return this->physicalBody_ && this->physicalBody_->isInWorld();
     }
 
@@ -292,46 +308,5 @@
     {
         this->mass_ = mass;
-        if (!this->hasPhysics())
-            return;
-        // TODO: Add this again when new network callbacks work properly
-            //COUT(3) << "Warning: Setting the mass of a WorldEntity with no physics has no effect." << std::endl;
-        else
-        {
-            if (this->physicalBody_->isInWorld())
-            {
-                COUT(2) << "Warning: Setting the mass of a WorldEntity at run time causes its physical body to be removed and added again." << std::endl;
-                removeFromPhysicalWorld();
-            }
-            internalSetMassProps();
-        }
-
-        addToPhysicalWorld();
-    }
-
-    void WorldEntity::internalSetMassProps()
-    {
-        assert(hasPhysics());
-
-        if (this->isStatic())
-        {
-            // Just set everything to zero
-            this->physicalBody_->setMassProps(0.0f, btVector3(0, 0, 0));
-        }
-        else if ((this->mass_ + this->childMass_) == 0.0f)
-        {
-            // Use default values to avoid very large or very small values
-            CCOUT(2) << "Warning: Setting the internal physical mass to 1.0 because mass_ is 0.0." << std::endl;
-            this->physicalBody_->setMassProps(1.0f, this->getLocalInertia(1.0f));
-        }
-        else
-            this->physicalBody_->setMassProps(this->mass_, this->getLocalInertia(this->mass_ + this->childMass_));
-    }
-
-    btVector3 WorldEntity::getLocalInertia(btScalar mass) const
-    {
-        btVector3 inertia(0, 0, 0);
-        if (this->collisionShape_->getCollisionShape())
-            this->collisionShape_->getCollisionShape()->calculateLocalInertia(mass, inertia);
-        return inertia;
+        recalculatePhysicsProps();
     }
 
@@ -341,5 +316,5 @@
         if (this->parent_)
             ThrowException(PhysicsViolation, "Cannot set the collision type of a WorldEntity with a parent");
-        else if (this->physicalBody_ && this->physicalBody_->isInWorld())
+        else if (this->addedToPhysicalWorld())
             ThrowException(PhysicsViolation, "Warning: Cannot set the collision type at run time.");
 
@@ -357,7 +332,6 @@
             // Create new rigid body
             btCollisionShape* temp = 0;
-            if (this->collisionShape_)
-                temp = this->collisionShape_->getCollisionShape();
-            btRigidBody::btRigidBodyConstructionInfo bodyConstructionInfo(0, this, temp, btVector3(0,0,0));
+            btRigidBody::btRigidBodyConstructionInfo bodyConstructionInfo(0, this, this->collisionShape_->getCollisionShape());
+            bodyConstructionInfo.m_restitution = 1;
             this->physicalBody_ = new btRigidBody(bodyConstructionInfo);
             this->physicalBody_->setUserPointer(this);
@@ -368,5 +342,5 @@
             // Destroy rigid body
             assert(this->physicalBody_);
-            removeFromPhysicalWorld();
+            deactivatePhysics();
             delete this->physicalBody_;
             this->physicalBody_ = 0;
@@ -392,12 +366,12 @@
         }
 
-        // update our variable for faster checks
+        // Only sets this->collisionShape_
+        // However the assertion is to ensure that the internal bullet setting is right
         updateCollisionType();
         assert(this->collisionType_ == type);
 
         // update mass and inertia tensor
-        internalSetMassProps(); // type is not None! See case None in switch
-
-        addToPhysicalWorld();
+        recalculatePhysicsProps();
+        activatePhysics();
     }
 
@@ -450,19 +424,55 @@
     }
 
-    bool WorldEntity::isPhysicsRunning() const
-    {
-        return this->physicalBody_ && this->physicalBody_->isInWorld();
-    }
-
-    bool WorldEntity::checkPhysics() const
-    {
-        if (!this->physicalBody_)
-        {
-            assert(this->getCollisionType() == None);
-            COUT(2) << "WorldEntity was not fitted with physics, cannot set phyiscal property." << std::endl;
-            return false;
-        }
-        else
-            return true;
+    void WorldEntity::notifyChildMassChanged() // Called by a child WE
+    {
+        // Note: CollisionShape changes of a child get handled over the internal CompoundCollisionShape already
+        // Recalculate mass
+        this->childrenMass_ = 0.0f;
+        for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)
+            this->childrenMass_ += (*it)->getMass();
+        recalculatePhysicsProps();
+        // Notify parent WE
+        if (this->parent_)
+            parent_->notifyChildMassChanged();
+    }
+
+    void WorldEntity::notifyCollisionShapeChanged() // called by this->collisionShape_
+    {
+        if (hasPhysics())
+        {
+            // Bullet doesn't like sudden changes of the collision shape, so we remove and add it again
+            if (this->addedToPhysicalWorld())
+            {
+                this->deactivatePhysics();
+                this->physicalBody_->setCollisionShape(this->collisionShape_->getCollisionShape());
+                this->activatePhysics();
+            }
+            else
+                this->physicalBody_->setCollisionShape(this->collisionShape_->getCollisionShape());
+        }
+        recalculatePhysicsProps();
+    }
+
+    void WorldEntity::recalculatePhysicsProps()
+    {
+        if (this->hasPhysics())
+        {
+            if (this->isStatic())
+            {
+                // Just set everything to zero
+                this->physicalBody_->setMassProps(0.0f, btVector3(0, 0, 0));
+            }
+            else if ((this->mass_ + this->childrenMass_) == 0.0f)
+            {
+                // Use default values to avoid very large or very small values
+                CCOUT(4) << "Warning: Setting the internal physical mass to 1.0 because mass_ is 0.0." << std::endl;
+                this->physicalBody_->setMassProps(1.0f, this->collisionShape_->getLocalInertia(1.0f));
+            }
+            else
+            {
+                float mass = this->mass_ + this->childrenMass_;
+                this->physicalBody_->setMassProps(mass, this->collisionShape_->getLocalInertia(mass));
+            }
+        }
     }
 }
Index: code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h
===================================================================
--- code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2421)
+++ code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2423)
@@ -35,5 +35,4 @@
 #define OGRE_FORCE_ANGLE_TYPES
 #include <OgreSceneNode.h>
-
 #include "LinearMath/btMotionState.h"
 
@@ -126,8 +125,6 @@
 
             void attach(WorldEntity* object);
-//            void attachAsdf(BlinkingBillboard* object);
             void detach(WorldEntity* object);
             WorldEntity* getAttachedObject(unsigned int index) const;
-//            BlinkingBillboard* getAttachedAsdfObject(unsigned int index) const;
             inline const std::set<WorldEntity*>& getAttachedObjects() const
                 { return this->children_; }
@@ -146,4 +143,6 @@
             inline WorldEntity* getParent() const
                 { return this->parent_; }
+
+            void notifyChildPropsChanged();
 
         protected:
@@ -185,9 +184,13 @@
             };
 
-            bool hasPhysics()  const { return getCollisionType() != None     ; }
-            bool isStatic()    const { return getCollisionType() == Static   ; }
-            bool isKinematic() const { return getCollisionType() == Kinematic; }
-            bool isDynamic()   const { return getCollisionType() == Dynamic  ; }
-            bool isPhysicsRunning() const;
+            bool hasPhysics()       const { return getCollisionType() != None     ; }
+            bool isStatic()         const { return getCollisionType() == Static   ; }
+            bool isKinematic()      const { return getCollisionType() == Kinematic; }
+            bool isDynamic()        const { return getCollisionType() == Dynamic  ; }
+            bool isPhysicsActive()  const { return this->bPhysicsActive_; }
+            bool addedToPhysicalWorld() const;
+
+            void activatePhysics();
+            void deactivatePhysics();
 
             inline CollisionType getCollisionType() const
@@ -201,6 +204,9 @@
             inline float getMass() const
                 { return this->mass_; }
-
-            void attachCollisionShape(CollisionShape* shape, bool bWorldEntityRoot = false);
+            inline float getTotalMass() const
+                { return this->mass_ + this->childrenMass_; }
+
+            void attachCollisionShape(CollisionShape* shape);
+            void detachCollisionShape(CollisionShape* shape);
             CollisionShape* getAttachedCollisionShape(unsigned int index) const;
 
@@ -210,4 +216,7 @@
                 { return this->physicalBody_; }
 
+            void notifyCollisionShapeChanged();
+            void notifyChildMassChanged();
+
         protected:
             virtual bool isCollisionTypeLegal(CollisionType type) const = 0;
@@ -217,20 +226,18 @@
         private:
             void updateCollisionType();
-            void mergeCollisionShape(CollisionShape* shape);
-            void internalSetMassProps();
-            btVector3 getLocalInertia(btScalar mass) const;
-            bool checkPhysics() const;
-            void addToPhysicalWorld() const;
-            void removeFromPhysicalWorld() const;
+            void recalculatePhysicsProps();
 
             // network callbacks
             void collisionTypeChanged();
             void massChanged();
+            void physicsActivityChanged();
 
             CollisionType                collisionType_;
             CollisionType                collisionTypeSynchronised_;
+            bool                         bPhysicsActive_;
+            bool                         bPhysicsActiveSynchronised_;
             CompoundCollisionShape*      collisionShape_;
             btScalar                     mass_;
-            btScalar                     childMass_;
+            btScalar                     childrenMass_;
     };
 }
