Index: code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc	(revision 2427)
+++ code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc	(revision 2429)
@@ -67,9 +67,9 @@
         XMLPortParamTemplate(CollisionShape, "position", setPosition, getPosition, xmlelement, mode, const Vector3&);
         XMLPortParamTemplate(CollisionShape, "orientation", setOrientation, getOrientation, xmlelement, mode, const Quaternion&);
+        XMLPortParamTemplate(CollisionShape, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&);
+        XMLPortParamLoadOnly(CollisionShape, "scale", setScale, xmlelement, mode);
         XMLPortParamLoadOnly(CollisionShape, "yaw",   yaw,   xmlelement, mode);
         XMLPortParamLoadOnly(CollisionShape, "pitch", pitch, xmlelement, mode);
         XMLPortParamLoadOnly(CollisionShape, "roll",  roll,  xmlelement, mode);
-        XMLPortParamTemplate(CollisionShape, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&);
-        XMLPortParamLoadOnly(CollisionShape, "scale", setScale, xmlelement, mode);
     }
 
Index: code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2427)
+++ code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.cc	(revision 2429)
@@ -72,8 +72,14 @@
         this->bPhysicsActive_ = false;
         this->collisionShape_ = new CompoundCollisionShape(this);
-        this->mass_ = 0;
-        this->childrenMass_ = 0;
         this->collisionType_ = None;
         this->collisionTypeSynchronised_ = None;
+        this->mass_           = 0;
+        this->childrenMass_   = 0;
+        // Use bullet default values
+        this->restitution_    = 0;
+        this->angularFactor_  = 1;
+        this->linearDamping_  = 0;
+        this->angularDamping_ = 0;
+        this->friction_       = 0.5;
 
         this->registerVariables();
@@ -103,17 +109,22 @@
         SUPER(WorldEntity, XMLPort, xmlelement, mode);
 
-        XMLPortParamTemplate(WorldEntity, "position", setPosition, getPosition, xmlelement, mode, const Vector3&);
+        XMLPortParamTemplate(WorldEntity, "position",    setPosition,    getPosition,    xmlelement, mode, const Vector3&);
         XMLPortParamTemplate(WorldEntity, "orientation", setOrientation, getOrientation, xmlelement, mode, const Quaternion&);
-        XMLPortParamLoadOnly(WorldEntity, "lookat", lookAt_xmlport, xmlelement, mode);
-        XMLPortParamLoadOnly(WorldEntity, "direction", setDirection_xmlport, xmlelement, mode);
-        XMLPortParamLoadOnly(WorldEntity, "yaw", yaw_xmlport, xmlelement, mode);
-        XMLPortParamLoadOnly(WorldEntity, "pitch", pitch_xmlport, xmlelement, mode);
-        XMLPortParamLoadOnly(WorldEntity, "roll", roll_xmlport, xmlelement, mode);
-        XMLPortParamTemplate(WorldEntity, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&);
-        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, mode);
+        XMLPortParamTemplate(WorldEntity, "scale3D",     setScale3D,     getScale3D,     xmlelement, mode, const Vector3&);
+        XMLPortParam        (WorldEntity, "scale",       setScale,       getScale,       xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "lookat",      lookAt_xmlport,       xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "direction",   setDirection_xmlport, xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "yaw",         yaw_xmlport,          xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "pitch",       pitch_xmlport,        xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "roll",        roll_xmlport,         xmlelement, mode);
 
         // Physics
-        XMLPortParam(WorldEntity, "collisionType", setCollisionTypeStr, getCollisionTypeStr, xmlelement, mode);
-        XMLPortParam(WorldEntity, "mass", setMass, getMass, xmlelement, mode);
+        XMLPortParam(WorldEntity, "collisionType",  setCollisionTypeStr, getCollisionTypeStr, xmlelement, mode);
+        XMLPortParam(WorldEntity, "mass",           setMass,             getMass,             xmlelement, mode);
+        XMLPortParam(WorldEntity, "restitution",    setRestitution,      getRestitution,      xmlelement, mode);
+        XMLPortParam(WorldEntity, "angularFactor",  setAngularFactor,    getAngularFactor,    xmlelement, mode);
+        XMLPortParam(WorldEntity, "linearDamping",  setLinearDamping,    getLinearDamping,    xmlelement, mode);
+        XMLPortParam(WorldEntity, "angularDamping", setAngularDamping,   getAngularDamping,   xmlelement, mode);
+        XMLPortParam(WorldEntity, "friction",       setFriction,         getFriction,         xmlelement, mode);
 
         // Other attached WorldEntities
@@ -125,19 +136,24 @@
     void WorldEntity::registerVariables()
     {
-        REGISTERDATA(this->bActive_,     network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
-        REGISTERDATA(this->bVisible_,    network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
-
-        REGISTERDATA(this->getScale3D(), network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
+        REGISTERDATA(this->bActive_,        network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
+        REGISTERDATA(this->bVisible_,       network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
+
+        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));
+                                            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->restitution_,    network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged));
+        REGISTERDATA(this->angularFactor_,  network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged));
+        REGISTERDATA(this->linearDamping_,  network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged));
+        REGISTERDATA(this->angularDamping_, network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));
+        REGISTERDATA(this->friction_,       network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));
         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));
-    }
-
-    void WorldEntity::updateParent()
+                                            network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));
+
+        REGISTERDATA(this->parentID_,       network::direction::toclient, new network::NetworkCallback<WorldEntity>(this, &WorldEntity::parentChanged));
+    }
+
+    void WorldEntity::parentChanged()
     {
         WorldEntity* parent = dynamic_cast<WorldEntity*>(Synchronisable::getSynchronisable(this->parentID_));
@@ -162,9 +178,4 @@
                 this->setCollisionType(this->collisionTypeSynchronised_);
         }
-    }
-
-    void WorldEntity::massChanged()
-    {
-        this->setMass(this->mass_);
     }
 
@@ -214,5 +225,5 @@
         // mass
         this->childrenMass_ += object->getMass();
-        recalculatePhysicsProps();
+        recalculateMassProps();
     }
 
@@ -225,5 +236,5 @@
         {
             this->childrenMass_ -= object->getMass();
-            recalculatePhysicsProps();
+            recalculateMassProps();
         }
 
@@ -418,10 +429,4 @@
     }
 
-    void WorldEntity::setMass(float mass)
-    {
-        this->mass_ = mass;
-        recalculatePhysicsProps();
-    }
-
     void WorldEntity::setCollisionType(CollisionType type)
     {
@@ -430,9 +435,11 @@
             ThrowException(PhysicsViolation, "Cannot set the collision type of a WorldEntity with a parent");
         else if (this->addedToPhysicalWorld())
-            ThrowException(PhysicsViolation, "Warning: Cannot set the collision type at run time.");
+            ThrowException(PhysicsViolation, "Cannot set the collision type at run time.");
 
         // Check for type legality. Could be StaticEntity or MobileEntity
         if (!this->isCollisionTypeLegal(type))
             return; // exception gets issued anyway
+        if (type != None && !this->getScene()->hasPhysics())
+            ThrowException(PhysicsViolation, "Cannot have physical bodies in a non physical scene");
 
         // Check whether we have to create or destroy.
@@ -444,7 +451,5 @@
 
             // Create new rigid body
-            btCollisionShape* temp = 0;
             btRigidBody::btRigidBodyConstructionInfo bodyConstructionInfo(0, this, this->collisionShape_->getCollisionShape());
-            bodyConstructionInfo.m_restitution = 1;
             this->physicalBody_ = new btRigidBody(bodyConstructionInfo);
             this->physicalBody_->setUserPointer(this);
@@ -485,5 +490,6 @@
 
         // update mass and inertia tensor
-        recalculatePhysicsProps();
+        recalculateMassProps();
+        resetPhysicsProps();
         activatePhysics();
     }
@@ -544,5 +550,5 @@
         for (std::set<WorldEntity*>::const_iterator it = this->children_.begin(); it != this->children_.end(); ++it)
             this->childrenMass_ += (*it)->getMass();
-        recalculatePhysicsProps();
+        recalculateMassProps();
         // Notify parent WE
         if (this->parent_)
@@ -564,8 +570,8 @@
                 this->physicalBody_->setCollisionShape(this->collisionShape_->getCollisionShape());
         }
-        recalculatePhysicsProps();
-    }
-
-    void WorldEntity::recalculatePhysicsProps()
+        recalculateMassProps();
+    }
+
+    void WorldEntity::recalculateMassProps()
     {
         if (this->hasPhysics())
@@ -589,3 +595,14 @@
         }
     }
+
+    void WorldEntity::resetPhysicsProps()
+    {
+        if (this->hasPhysics())
+        {
+            this->physicalBody_->setRestitution(this->restitution_);
+            this->physicalBody_->setAngularFactor(this->angularFactor_);
+            this->physicalBody_->setDamping(this->linearDamping_, this->angularDamping_);
+            this->physicalBody_->setFriction(this->friction_);
+        }
+    }
 }
Index: code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h
===================================================================
--- code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2427)
+++ code/branches/physics/src/orxonox/objects/worldentities/WorldEntity.h	(revision 2429)
@@ -141,6 +141,4 @@
 
         private:
-            void updateParent();
-
             inline void lookAt_xmlport(const Vector3& target)
                 { this->lookAt(target); }
@@ -154,4 +152,6 @@
                 { this->roll(angle); }
 
+            // network callbacks
+            void parentChanged();
             inline void scaleChanged()
                 { this->setScale3D(this->getScale3D()); }
@@ -192,9 +192,36 @@
             std::string getCollisionTypeStr() const;
 
-            void setMass(float mass);
+            inline void setMass(float mass)
+                { this->mass_ = mass; recalculateMassProps(); }
             inline float getMass() const
                 { return this->mass_; }
+
             inline float getTotalMass() const
                 { return this->mass_ + this->childrenMass_; }
+
+            inline void setRestitution(float restitution)
+                { this->restitution_ = restitution; resetPhysicsProps(); }
+            inline float getRestitution() const
+                { return this->restitution_; }
+
+            inline void setAngularFactor(float angularFactor)
+                { this->angularFactor_ = angularFactor; resetPhysicsProps(); }
+            inline float getAngularFactor() const
+                { return this->angularFactor_; }
+
+            inline void setLinearDamping(float linearDamping)
+                { this->linearDamping_ = linearDamping; resetPhysicsProps(); }
+            inline float getLinearDamping() const
+                { return this->linearDamping_; }
+
+            inline void setAngularDamping(float angularDamping)
+                { this->angularDamping_ = angularDamping; resetPhysicsProps(); }
+            inline float getAngularDamping() const
+                { return this->angularDamping_; }
+
+            inline void setFriction(float friction)
+                { this->friction_ = friction; resetPhysicsProps(); }
+            inline float getFriction() const
+                { return this->friction_; }
 
             void attachCollisionShape(CollisionShape* shape);
@@ -217,10 +244,22 @@
         private:
             void updateCollisionType();
-            void recalculatePhysicsProps();
+            void recalculateMassProps();
+            void resetPhysicsProps();
 
             // network callbacks
             void collisionTypeChanged();
-            void massChanged();
             void physicsActivityChanged();
+            inline void massChanged()
+                { this->setMass(this->mass_); }
+            inline void restitutionChanged()
+                { this->setRestitution(this->restitution_); }
+            inline void angularFactorChanged()
+                { this->setAngularFactor(this->angularFactor_); }
+            inline void linearDampingChanged()
+                { this->setLinearDamping(this->linearDamping_); }
+            inline void angularDampingChanged()
+                { this->setAngularDamping(this->angularDamping_); }
+            inline void frictionChanged()
+                { this->setFriction(this->friction_); }
 
             CollisionType                collisionType_;
@@ -230,4 +269,9 @@
             CompoundCollisionShape*      collisionShape_;
             btScalar                     mass_;
+            btScalar                     restitution_;
+            btScalar                     angularFactor_;
+            btScalar                     linearDamping_;
+            btScalar                     angularDamping_;
+            btScalar                     friction_;
             btScalar                     childrenMass_;
     };
