Index: /code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
===================================================================
--- /code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2452)
+++ /code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.cc	(revision 2453)
@@ -47,20 +47,18 @@
         RegisterObject(SpaceShip);
 
-        this->zeroDegree_ = 0;
+        this->primaryThrust_  = 100;
+        this->auxilaryThrust_ =  30;
+        this->rotationThrust_ =  10;
 
-        this->maxSpeed_ = 0;
-        this->maxSecondarySpeed_ = 0;
-        this->maxRotation_ = 0;
-        this->translationAcceleration_ = 0;
-        this->rotationAcceleration_ = 0;
-        this->translationDamping_ = 0;
-
-        this->yawRotation_ = 0;
-        this->pitchRotation_ = 0;
-        this->rollRotation_ = 0;
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
 
         this->bInvertYAxis_ = false;
 
         this->setDestroyWhenPlayerLeft(true);
+
+        // SpaceShip is always a physical object per default
+        // Be aware of this call: The collision type legality check will not reach derived classes!
+        this->setCollisionType(WorldEntity::Dynamic);
 
         this->setConfigValues();
@@ -76,25 +74,14 @@
         SUPER(SpaceShip, XMLPort, xmlelement, mode);
 
-        XMLPortParam(SpaceShip, "maxspeed",          setMaxSpeed,          getMaxSpeed,          xmlelement, mode);
-        XMLPortParam(SpaceShip, "maxsecondaryspeed", setMaxSecondarySpeed, getMaxSecondarySpeed, xmlelement, mode);
-        XMLPortParam(SpaceShip, "maxrotation",       setMaxRotation,       getMaxRotation,       xmlelement, mode);
-        XMLPortParam(SpaceShip, "transacc",          setTransAcc,          getTransAcc,          xmlelement, mode);
-        XMLPortParam(SpaceShip, "rotacc",            setRotAcc,            getRotAcc,            xmlelement, mode);
-        XMLPortParam(SpaceShip, "transdamp",         setTransDamp,         getTransDamp,         xmlelement, mode);
-
-        if (this->physicalBody_)
-        {
-            this->physicalBody_->setDamping(0.7, 0.3);
-        }
+        XMLPortParamVariable(SpaceShip, "primaryThrust",  primaryThrust_,  xmlelement, mode);
+        XMLPortParamVariable(SpaceShip, "auxilaryThrust", auxilaryThrust_, xmlelement, mode);
+        XMLPortParamVariable(SpaceShip, "rotationThrust", rotationThrust_, xmlelement, mode);
     }
 
     void SpaceShip::registerVariables()
     {
-        registerVariable(this->maxSpeed_,                variableDirection::toclient);
-        registerVariable(this->maxSecondarySpeed_,       variableDirection::toclient);
-        registerVariable(this->maxRotation_,             variableDirection::toclient);
-        registerVariable(this->translationAcceleration_, variableDirection::toclient);
-        registerVariable(this->rotationAcceleration_,    variableDirection::toclient);
-        registerVariable(this->translationDamping_,      variableDirection::toclient);
+        registerVariable(this->primaryThrust_,  variableDirection::toclient);
+        registerVariable(this->auxilaryThrust_, variableDirection::toclient);
+        registerVariable(this->rotationThrust_, variableDirection::toclient);
     }
 
@@ -104,38 +91,64 @@
     }
 
+    bool SpaceShip::isCollisionTypeLegal(WorldEntity::CollisionType type) const
+    {
+        if (type != WorldEntity::Dynamic)
+        {
+            ThrowException(PhysicsViolation, "Cannot tell a SpaceShip not to be dynamic!");
+            return false;
+        }
+        else
+            return true;
+    }
+
     void SpaceShip::tick(float dt)
     {
         SUPER(SpaceShip, tick, dt);
+
+        if (this->isLocallyControlled())
+        {
+            this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
+            this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
+            if (this->localLinearAcceleration_.z() > 0)
+                this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
+            else
+                this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+            this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
+            this->localLinearAcceleration_.setValue(0, 0, 0);
+
+            this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
+            this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
+            this->localAngularAcceleration_.setValue(0, 0, 0);
+        }
     }
 
     void SpaceShip::moveFrontBack(const Vector2& value)
     {
-        assert(this->physicalBody_);
-        this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * btVector3(0.0f, 0.0f, -getMass() * value.x * 100));
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
     }
 
     void SpaceShip::moveRightLeft(const Vector2& value)
     {
-        this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * btVector3(getMass() * value.x * 100, 0.0f, 0.0f));
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
     }
 
     void SpaceShip::moveUpDown(const Vector2& value)
     {
-        this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * btVector3(0.0f, getMass() * value.x * 100, 0.0f));
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
     }
 
     void SpaceShip::rotateYaw(const Vector2& value)
     {
-        this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * btVector3(0.0f, 1 / this->physicalBody_->getInvInertiaDiagLocal().y() * value.y * orientationGain, 0.0f));
+        this->localAngularAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
     }
 
     void SpaceShip::rotatePitch(const Vector2& value)
     {
-        this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * btVector3(1 / this->physicalBody_->getInvInertiaDiagLocal().x() * value.y * orientationGain, 0.0f, 0.0f));
+        this->localAngularAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
     }
 
     void SpaceShip::rotateRoll(const Vector2& value)
     {
-        this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * btVector3(0.0f, 0.0f, -1 / this->physicalBody_->getInvInertiaDiagLocal().z() * value.y * orientationGain));
+        this->localAngularAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
     }
 
Index: /code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.h
===================================================================
--- /code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.h	(revision 2452)
+++ /code/branches/physics_merge/src/orxonox/objects/worldentities/pawns/SpaceShip.h	(revision 2453)
@@ -32,4 +32,6 @@
 #include "OrxonoxPrereqs.h"
 
+#include "LinearMath/btVector3.h"
+
 #include "Pawn.h"
 
@@ -57,45 +59,16 @@
             virtual void fire();
 
-            void setMaxSpeed(float value)
-                { this->maxSpeed_ = value; }
-            void setMaxSecondarySpeed(float value)
-                { this->maxSecondarySpeed_ = value; }
-            void setMaxRotation(const Degree& value)
-                { this->maxRotation_ = value; }
-            void setTransAcc(float value)
-                { this->translationAcceleration_ = value; }
-            void setRotAcc(const Degree& value)
-                { this->rotationAcceleration_ = value; }
-            void setTransDamp(float value)
-                { this->translationDamping_ = value; }
-
-            inline float getMaxSpeed() const
-                { return this->maxSpeed_; }
-            inline float getMaxSecondarySpeed() const
-                { return this->maxSecondarySpeed_; }
-            inline float getMaxRotation() const
-                { return this->maxRotation_.valueDegrees(); }
-            inline float getTransAcc() const
-                { return this->translationAcceleration_; }
-            inline float getRotAcc() const
-                { return this->rotationAcceleration_.valueDegrees(); }
-            inline float getTransDamp() const
-                { return this->translationDamping_; }
-
         protected:
             bool bInvertYAxis_;
 
-            float maxSpeed_;
-            float maxSecondarySpeed_;
-            float translationAcceleration_;
-            float translationDamping_;
+            float primaryThrust_;
+            float auxilaryThrust_;
+            float rotationThrust_;
 
-            Degree maxRotation_;
-            Degree rotationAcceleration_;
+            btVector3 localLinearAcceleration_;
+            btVector3 localAngularAcceleration_;
 
-            Degree zeroDegree_;
-            Degree pitchRotation_;
-            Degree yawRotation_;
-            Degree rollRotation_;
+        private:
+            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
     };
 }
