Index: code/trunk/src/modules/objects/ForceField.cc
===================================================================
--- code/trunk/src/modules/objects/ForceField.cc	(revision 7675)
+++ code/trunk/src/modules/objects/ForceField.cc	(revision 7676)
@@ -28,6 +28,6 @@
 
 /**
-@file ForceField.cc
-@brief Implementation of the ForceField class.
+    @file ForceField.cc
+    @brief Implementation of the ForceField class.
 */
 
@@ -41,8 +41,12 @@
 {
     CreateFactory(ForceField);
-    
+
     /*static*/ const std::string ForceField::modeTube_s = "tube";
     /*static*/ const std::string ForceField::modeSphere_s = "sphere";
 
+    /**
+    @brief
+        Constructor. Registers the object and initializes some values.
+    */
     ForceField::ForceField(BaseObject* creator) : StaticEntity(creator)
     {
@@ -51,26 +55,39 @@
         //Standard Values
         this->setDirection(Vector3::ZERO);
-        this->velocity_ = 100;
-        this->diameter_ = 500;
-        this->length_ = 5000;
+        this->setVelocity(100);
+        this->setDiameter(500);
+        this->setLength(2000);
         this->mode_ = forceFieldMode::tube;
     }
 
+    /**
+    @brief
+        Destructor.
+    */
     ForceField::~ForceField()
     {
     }
 
+    /**
+    @brief
+        Creates a ForceField object through XML.
+    */
     void ForceField::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(ForceField, XMLPort, xmlelement, mode);
 
-        //For correct xml import use: position, direction, velocity, scale
         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, "mode", setMode, getMode, xmlelement, mode);
-        COUT(0) << "ForceField created " << this->velocity_ << " " << this->diameter_ << " " << this->radius_ << " " << this->length_ << " " << this->halfLength_ << " " << this->getMode() << std::endl;
     }
 
+    /**
+    @brief
+        A method that is called every tick.
+        Implements the behavior of teh ForceField.
+    @param dt
+        The amount of time that elapsed since the last tick.
+    */
     void ForceField::tick(float dt)
     {
@@ -87,5 +104,5 @@
                 // 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.
                 if(distanceVector.length() > this->halfLength_)
@@ -94,6 +111,6 @@
                 // The distance of the object form the orientation vector. (Or rather the smallest distance from the orientation vector)
                 float distanceFromDirectionVector = ((it->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
-                
-                // If the object in a tube of radius diameter/2 around the direction of orientation.
+
+                // If the object in a tube of radius 'radius' around the direction of orientation.
                 if(distanceFromDirectionVector >= this->radius_)
                     continue;
@@ -111,7 +128,9 @@
                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
                 float distance = distanceVector.length();
+                // If the object is within 'radius' distance.
                 if (distance < this->radius_)
                 {
                     distanceVector.normalise();
+                    // Apply a force proportional to the velocity, with highest force at the origin of the sphere, linear decreasing until reaching a distance of 'radius' from the origin, where the force reaches zero. 
                     it->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
                 }
@@ -119,5 +138,11 @@
         }
     }
-    
+
+    /**
+    @brief
+        Set the mode of the ForceField.
+    @param mode
+        The mode as a string.
+    */
     void ForceField::setMode(const std::string& mode)
     {
@@ -132,6 +157,12 @@
         }
     }
-    
-    inline const std::string& ForceField::getMode(void)
+
+    /**
+    @brief
+        Get the mode of the ForceField.
+    @return
+        Returns the mode of the ForceField as a string.
+    */
+    const std::string& ForceField::getMode(void)
     {
         switch(this->mode_)
@@ -145,8 +176,4 @@
         }
     }
+
 }
-
-
-
-
-
Index: code/trunk/src/modules/objects/ForceField.h
===================================================================
--- code/trunk/src/modules/objects/ForceField.h	(revision 7675)
+++ code/trunk/src/modules/objects/ForceField.h	(revision 7676)
@@ -33,10 +33,4 @@
 */
 
-/**
-@file ForceField.h
-@brief Definition of the ForceField class.
-@inGroup Objects
-*/
-
 #ifndef _ForceField_H__
 #define _ForceField_H__
@@ -53,6 +47,6 @@
     @brief
         The mode of the ForceField.
-    
-    @inGroup Objects
+
+    @ingroup Objects
     */
     namespace forceFieldMode
@@ -61,5 +55,4 @@
             tube, //!< The ForceField has a tube shape.
             sphere //!< The ForceField has a spherical shape.
-            
         };
     }
@@ -68,20 +61,21 @@
     @brief
         Implements a force field, that applies a force to any @ref orxonox::MoblieEnity "MobileEntity" that enters its range.
-        
+
         The following parameters can be set to specify the behavior of the ForceField.
-        - @b velocity The amount of force the ForceField excerts.
-        - @b diameter The diameter of the ForceField.
-        - @b length The length of the ForceField.
+        - @b velocity The amount of force the ForceField excerts. Default is 100.
+        - @b diameter The diameter of the ForceField. Default is 500.
+        - @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>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>.
-        
+            - <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>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>.
+
     @author
         Aurelian Jaggi
-        
+
     @author
         Damian 'Mozork' Frick
-        
-    @inGroup Objects
+
+    @ingroup Objects
     */
     class _ObjectsExport ForceField : public StaticEntity, public Tickable
@@ -90,42 +84,61 @@
             ForceField(BaseObject* creator);
             virtual ~ForceField();
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void tick(float dt);
 
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a ForceField object through XML.
+            virtual void tick(float dt); //!< A method that is called every tick.
+
+            /**
+            @brief Set the velocity of the ForceField.
+            @param vel The velocity to be set.
+            */
             inline void setVelocity(float vel)
                 { this->velocity_ = vel; }
-
+            /**
+            @brief Get the velocity of the ForceField.
+            @return Returns the velocity of the ForceField.
+            */
             inline float getVelocity()
                 { return this->velocity_; }
 
+            /**
+            @brief Set the diameter of the ForceField.
+            @param diam The diameter to be set.
+            */
             inline void setDiameter(float diam)
-                { this->diameter_ = diam; this->radius_ = diam/2; }
+                { this->radius_ = diam/2; }
+            /**
+            @brief Get the diameter of the ForceField.
+            @return Returns the diameter of the ForceField.
+            */
+            inline float getDiameter()
+                { return this->radius_*2; }
 
-            inline float getDiameter()
-                { return this->diameter_; }
+            /**
+            @brief Set the length of the ForceField.
+            @param l The length to be set.
+            */
+            inline void setLength(float l)
+                { this->halfLength_ = l/2; }
+            /**
+            @brief Get the length of the ForceField.
+            @return Returns the length of the ForceField.
+            */
+            inline float getLength()
+                { return this->halfLength_*2; }
 
-            inline void setLength(float l)
-                { this->length_ = l; this->halfLength_ = l/2; }
-
-            inline float getLength()
-                { return this->length_; }
-                
-            void setMode(const std::string& mode);
-                
-            inline const std::string& getMode(void);
+            void setMode(const std::string& mode); //!< Set the mode of the ForceField.
+            const std::string& getMode(void); //!< Get the mode of the ForceField.
 
         private:
+            //! Strings to represent the modes.
             static const std::string modeTube_s;
             static const std::string modeSphere_s;
-        
-            float velocity_;
-            float diameter_;
-            float radius_;
-            float length_;
-            float halfLength_;
-            forceFieldMode::Value mode_;
+
+            float velocity_; //!< The velocity of the ForceField.
+            float radius_; //!< The radius of the ForceField.
+            float halfLength_; //!< Half of the length of the ForceField.
+            forceFieldMode::Value mode_; //!< The mode of the ForceField.
   };
 }
 
 #endif
-
