Index: /code/trunk/data/levels/The Time Machine.oxw
===================================================================
--- /code/trunk/data/levels/The Time Machine.oxw	(revision 7676)
+++ /code/trunk/data/levels/The Time Machine.oxw	(revision 7677)
@@ -12,5 +12,4 @@
     include("templates/spaceship_pirate.oxt")
 ?>
-
 
 <!--*****************************************************************************************************************************************************************************************-->
@@ -73,5 +72,5 @@
         skybox="Orxonox/skypanoramagen2"
     >
-    
+
         <Light type=directional position="0,0,0" direction="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 1.0, 0.9" />
 
@@ -268,4 +267,5 @@
     
 <!--TIME MACHINE____________________________________________________________________________________________________________________________________________________________________________-->
+<ForceField mode="invertedSphere" position="0,0,0" velocity=50000 diameter=6500 length=500 />
         <StaticEntity>
             <attached>
Index: /code/trunk/src/modules/objects/ForceField.cc
===================================================================
--- /code/trunk/src/modules/objects/ForceField.cc	(revision 7676)
+++ /code/trunk/src/modules/objects/ForceField.cc	(revision 7677)
@@ -44,4 +44,5 @@
     /*static*/ const std::string ForceField::modeTube_s = "tube";
     /*static*/ const std::string ForceField::modeSphere_s = "sphere";
+    /*static*/ const std::string ForceField::modeInvertedSphere_s = "invertedSphere";
 
     /**
@@ -79,5 +80,5 @@
         XMLPortParam(ForceField, "velocity", setVelocity, getVelocity, xmlelement, mode).defaultValues(100);
         XMLPortParam(ForceField, "diameter", setDiameter, getDiameter, xmlelement, mode).defaultValues(500);
-        XMLPortParam(ForceField, "length"  , setLength  , getLength  , xmlelement, mode).defaultValues(2000);
+        XMLPortParam(ForceField, "length", setLength  , getLength  , xmlelement, mode).defaultValues(2000);
         XMLPortParam(ForceField, "mode", setMode, getMode, xmlelement, mode);
     }
@@ -102,8 +103,7 @@
 
                 // Vector from the center of the force field to the object its acting on.
-                // TODO: This could probably be simplified.
                 Vector3 distanceVector = it->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
 
-                // The object is outside of the length of the ForceField.
+                // The object is outside a ball around the center with radius length/2 of the ForceField.
                 if(distanceVector.length() > this->halfLength_)
                     continue;
@@ -137,4 +137,21 @@
             }
         }
+        else if(this->mode_ == forceFieldMode::invertedSphere)
+        {
+            // Iterate over all objects that could possibly be affected by the ForceField.
+            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+            {
+                Vector3 distanceVector = this->getWorldPosition() - it->getWorldPosition();
+                float distance = distanceVector.length();
+                // If the object is within 'radius' distance and no more than 'length' away from the boundary of the sphere.
+                float range = this->radius_ - this->halfLength_*2;
+                if (distance < this->radius_ && distance > range)
+                {
+                    distanceVector.normalise();
+                    // Apply a force proportional to the velocity, with highest force at the boundary of the sphere, linear decreasing until reaching a distance of 'radius-length' from the origin, where the force reaches zero.
+                    it->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
+                }
+            }
+        }
     }
 
@@ -151,4 +168,6 @@
         else if(mode == ForceField::modeSphere_s)
             this->mode_ = forceFieldMode::sphere;
+        else if(mode == ForceField::modeInvertedSphere_s)
+            this->mode_ = forceFieldMode::invertedSphere;
         else
         {
@@ -172,4 +191,6 @@
             case forceFieldMode::sphere:
                 return ForceField::modeSphere_s;
+            case forceFieldMode::invertedSphere:
+                return ForceField::modeInvertedSphere_s;
             default:
                 return ForceField::modeTube_s;
Index: /code/trunk/src/modules/objects/ForceField.h
===================================================================
--- /code/trunk/src/modules/objects/ForceField.h	(revision 7676)
+++ /code/trunk/src/modules/objects/ForceField.h	(revision 7677)
@@ -54,5 +54,6 @@
         enum Value {
             tube, //!< The ForceField has a tube shape.
-            sphere //!< The ForceField has a spherical shape.
+            sphere, //!< The ForceField has a spherical shape.
+            invertedSphere //!< The ForceField has a spherical shape but "inverted" behavior.
         };
     }
@@ -67,7 +68,8 @@
         - @b length The length of the ForceField. Default is 2000.
         - @b mode The mode the ForceField is in. For mode:
-            - <em>tube</em> A ForceField which exerts force only in the direction it is oriented. The force is only exerted on objects that are in a tube of length <em>length</em> and diameter <em>diameter</em>. The magintude of the force is proportional to the <em>velocity</em>, being highest when an object is in the middle of the tube (radius-wise), linearly decreasing with greater radii and finally reaching zero, when the object is <code>diameter/2</code> away from the orientation vector.
+            - <em>tube</em> A ForceField which exerts force only in the direction it is oriented. The force is only exerted on objects that are in a tube of length <em>length</em> and diameter <em>diameter</em> (with rounded start and end faces, so in fact the <em>length</em> parameter specifies a ball with <code>origin + length/2</code> as the center and <code>length/2</code> as the radius). The magintude of the force is proportional to the <em>velocity</em>, being highest when an object is in the middle of the tube (radius-wise), linearly decreasing with greater radii and finally reaching zero, when the object is <code>diameter/2</code> away from the orientation vector.
             - <em>sphere</em> A Force Field which exerts force radially away from itself, with the greatest magnitude (proportional to <em>velocity</em>) being in the origin of the ForceField, linearly decreasing with respect to the distance to the origin and finally reaching zero at distance <code>diameter/2</code>.
             Default is <em>tube</em>.
+            - <em>invertedSphere</em> 
 
     @author
@@ -134,4 +136,5 @@
             static const std::string modeTube_s;
             static const std::string modeSphere_s;
+            static const std::string modeInvertedSphere_s;
 
             float velocity_; //!< The velocity of the ForceField.
