Index: /code/branches/Presentation_HS17_merge/data/levels/AsteroidFarming.oxw
===================================================================
--- /code/branches/Presentation_HS17_merge/data/levels/AsteroidFarming.oxw	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/data/levels/AsteroidFarming.oxw	(revision 11730)
@@ -0,0 +1,142 @@
+<LevelInfo
+ name = "AsteroidFarming"
+ description = "Testing the Asteroid Mining Project, PPS HS 17"
+ tags = "test, showcase"
+ screenshot = "AsteroidFarming.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDPickupTemplate.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+
+<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
+
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+    hasPhysics = true
+  >
+
+
+  <?lua
+      include("includes/pickups.oxi")
+  ?>
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+    <SpawnPoint team=0 position="0,0,0" direction="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+    
+
+     <!-- Asteroid Display: -->
+      <Model position="0,  0,40" yaw="90" pitch="-90" roll="0" scale="3" mesh="ast1.mesh" />
+      <Model position="0, 20,40" yaw="90" pitch="-90" roll="0" scale="3" mesh="ast2.mesh" />
+      <Model position="0, 40,40" yaw="90" pitch="-90" roll="0" scale="3" mesh="ast3.mesh" />
+      <Model position="0, 60,40" yaw="90" pitch="-90" roll="0" scale="3" mesh="ast4.mesh" />
+      <Model position="0,-20,40" yaw="90" pitch="-90" roll="0" scale="4" mesh="ast5.mesh" />
+      <Model position="0,-40,40" yaw="90" pitch="-90" roll="0" scale="4" mesh="ast6.mesh" />
+      <Model position="0,-60,40" yaw="90" pitch="-90" roll="0" scale="5" mesh="asteroid_ice.mesh" />
+      <Model position="0,-80,40" yaw="90" pitch="-90" roll="0" scale="5" mesh="asteroid_UV.mesh" />
+
+     <!-- Display some pickup, 'Meta' -->
+    <PickupSpawner pickup=usemetapickup position="-25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=dropmetapickup position="0,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=destroymetapickup position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+    <PickupSpawner pickup=destroycarriermetapickup position="50,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10" />
+
+    <!-- Drone pickup -->
+    <PickupSpawner pickup=dronepickup position="-25,100,-125" triggerDistance="10" respawnTime="30" maxSpawnedItems="10" />
+
+
+    <!-- @Objects: 4 boxes (uncontrolled pawns) Trying to understand the pickup generation-->
+    <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+
+    </Pawn>
+
+    <!----Just a box with different mesh-->
+    <Pawn team=1 health=50 position="0,1000,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Globi Asteroid" >
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="ast4.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+    </Pawn>
+
+
+    <!-- AsteroidMinable -->
+    <AsteroidMinable size=15 position="0,-500,0" />
+    <AsteroidMinable size=5 position="100,-500,100" />
+    <AsteroidMinable size=50 position="500,-500, 500" />
+    <AsteroidMinable size=30 position="-100, -500, -100" velocity= "0, -30, 0"/>
+
+    <!-- SpicedAsteroidField -->
+    <SpicedAsteroidField count=30 mDensity= 0.5 maxSize=40 minSize=1 position="5000, 0, 0" radius=1000 velocity="0,0,0"/>
+
+
+    <!-- Asteroid Belt with a planet -->
+
+    <SpicedAsteroidBelt position="-15000,0,0" mDensity=0.3 segments=50 minSize=1 maxSize=50 radius0=7190 radius1 = 7800 count=250 tiltBy=0.5 tiltAt=0/>
+    <Planet
+      position="-15000,0,0"
+      scale="5000"
+      collisionType="dynamic"
+      linearDamping="0.8"
+      angularDamping="0"
+      mass="10000000"
+      pitch="0"
+      mesh="planets/muunilinst.mesh"
+      atmosphere="atmosphere1"
+      rotationaxis="1,0,0"
+      rotationrate="1.0"
+      atmospheresize="80.0f"
+      imagesize="1024.0f"
+      collisiondamage = 2
+      enablecollisiondamage = true
+    >      
+      <attached>
+        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+      </attached>
+      <collisionShapes>
+        <SphereCollisionShape radius="5000" position="0,0,0" />
+      </collisionShapes>
+    </Planet>
+
+
+
+
+  </Scene>
+</Level>
Index: /code/branches/Presentation_HS17_merge/src/modules/CMakeLists.txt
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/CMakeLists.txt	(revision 11729)
+++ /code/branches/Presentation_HS17_merge/src/modules/CMakeLists.txt	(revision 11730)
@@ -26,4 +26,5 @@
 ################ Sub Directories ################
 
+ADD_SUBDIRECTORY(asteroidmining)
 ADD_SUBDIRECTORY(dialogue)
 ADD_SUBDIRECTORY(designtools)
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.cc
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.cc	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.cc	(revision 11730)
@@ -0,0 +1,459 @@
+
+ /*   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Simon Miescher
+ *
+ */
+
+/*
+
+    @file
+    @author remartin
+    @brief An asteroid which can be destroyed. Some smaller asteroids are created and a pickup spawns. 
+
+HANDBUCH:
+o Die Collision Shape kann nur im Konstruktor hinzugefügt werden. Die XML-Argumente werden aber erst nach dem Konstruktor gesetzt. 
+  Darum wird hier beim ersten Aufruf der tick()-Methode via putStuff() ein komplett neuer Asteroid generiert und der alte zerstört. 
+o im Level-File includes/pickups.oxi importieren. 
+
+OFFEN/Weiterentwicklung: 
+o @TODO Add resource pickups. 
+--> data_extern/images/effects: PNG's für die Pickups
+--> https://www.orxonox.net/jenkins/view/Management/job/orxonox_doxygen_trunk/javadoc/group___pickup.html
+
+o Density doesn't add up to 1...
+o Does collision damage work properly
+o Add sound effect (crunching etc. ) (No sound in space...)
+o Explosion parts
+
+ANDERORTS VERÄNDERTE SACHEN: 
+Pickup-Zeug: 
+o Pickup.h: createSpawner() neu public statt private
+o PickupSpawner.h: Zugriffsrechte setPickupTemplateName() und setMaxSpawnedItems()
+o PickupSpawner.h: In Tick() zwei Testbedingungen eingefügt.
+o Pawn.h: Attribut acceptsPickups_ inklusive get/set. 
+
+ERLEGTE FEHLER:
+o Grössenabhängige Collision Shape -> putStuff-Methode, Werte noch nicht durchgesickert. 
+o setHealth: maxHealth() des pawns setzen! 
+o Asteroiden fressen Pickups: Argument in Pawn, Test darauf in Tick() von PickupSpawner. 
+o i++ einfach ganz verhindern, ++i stattdessen. 
+o Velocity didn-t get passed properly through the 2nd constructor. Used get/set instead. 
+o Rand() geht bis zu riesigen Nummern! rnd() ist zwischen 0 und 1
+
+NOTIZEN:
+o SUPER
+o Warnungsverhinderung anderswo: (void)pickedUp; // To avoid compiler warning.
+o friend class Pickupable;
+
+
+
+*/
+
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+#include "../../orxonox/worldentities/WorldEntity.h"
+
+#include "AsteroidMinable.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "network/NetworkFunction.h" 
+#include "util/Math.h"
+
+#include "../pickup/PickupSpawner.h"
+#include "../pickup/Pickup.h"
+
+#include "../objects/collisionshapes/SphereCollisionShape.h"
+#include "../../orxonox/graphics/Model.h"
+
+
+namespace orxonox{
+
+    RegisterClass(AsteroidMinable);
+
+    // @brief Standard constructor
+    AsteroidMinable::AsteroidMinable(Context* context) : Pawn(context){
+
+        RegisterObject(AsteroidMinable);
+        this->context = context;
+
+        // Default Values:
+        this->size = 10; 
+        this->dropStuff = true; 
+        this->generateSmaller = true; 
+        this->health_ = 15*size; 
+        this->maxHealth_ = this->health_;
+        this->acceptsPickups_ = false; 
+
+        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
+        this->enableCollisionCallback();
+
+        // Old from Pawn
+        this->registerVariables();
+
+        this->initialised = false;
+    }
+
+    // @brief Use this constructor with care. Mainly used internally, arguments are passed directly. 
+    AsteroidMinable::AsteroidMinable(Context* c, float size, Vector3 position, bool dropStuff) : Pawn(c){
+
+        RegisterObject(AsteroidMinable);
+
+        // The radar is able to detect whether an asteroid contains resources....
+        if(dropStuff){
+            this->setRadarObjectColour(ColourValue(1.0f, 1.0f, 0.0f, 1.0f));
+            this->setRadarObjectShape(RadarViewable::Shape::Dot);
+        }else{
+            // Somehow remove from radar? (all pawns get registered automatically... )
+            this->setRadarObjectColour(ColourValue(0.663f, 0.663f, 0.663f, 1.0f));
+            this->setRadarObjectShape(RadarViewable::Shape::Dot);
+        }
+
+        this->context = c;
+        this->size = size;
+        this->health_ = 15*size; 
+        this->maxHealth_ = this->health_;
+        this->acceptsPickups_ = false; 
+        this->generateSmaller = true; 
+        this->dropStuff = dropStuff; 
+
+        this->setPosition(position);
+        //this->roll = rand()*5; //etwas Drehung. Richtige Variable?
+
+        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
+        this->enableCollisionCallback();
+
+        // Add Model, random one of the 6 shapes
+        Model* hull = new Model(this->context);
+        char meshThingy[] = "";
+        sprintf(meshThingy, "ast%.0f.mesh", round(5*rnd())+1); 
+        hull->setMeshSource(meshThingy);
+        hull->setScale(this->size);
+        this->attach(hull);
+
+        // Collision shape
+        SphereCollisionShape* cs = new SphereCollisionShape(this->context);
+        cs->setRadius((this->size)*2); //OFFEN: Feinabstimmung der Radien. 
+        this->attachCollisionShape(cs); 
+
+        this->registerVariables();
+
+        this->initialised=true; 
+
+    }
+
+    AsteroidMinable::~AsteroidMinable(){
+
+    }
+
+    // @brief Helper method. 
+    void AsteroidMinable::putStuff(){
+
+        AsteroidMinable* reborn = new AsteroidMinable(this->context, this->size, this->getPosition(), this->dropStuff);
+        reborn->setVelocity(this->getVelocity());
+        // reborn->setAngularVelocity(this->getAngularVelocity()); // Add all other stuff, too?
+        (void)reborn; // avoid compiler warning
+
+        this->bAlive_ = false;
+        this->destroyLater();
+
+    }
+
+    void AsteroidMinable::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+
+        SUPER(AsteroidMinable, XMLPort, xmlelement, mode); 
+
+        XMLPortParam(AsteroidMinable, "size", setSize, getSize, xmlelement, mode);
+        XMLPortParam(AsteroidMinable, "generateSmaller", toggleShattering, doesShatter, xmlelement, mode);
+        XMLPortParam(AsteroidMinable, "dropStuff", toggleDropStuff, doesDropStuff, xmlelement, mode); 
+
+    }
+
+    void AsteroidMinable::XMLEventPort(Element& xmlelement, XMLPort::Mode mode){
+
+        SUPER(AsteroidMinable, XMLEventPort, xmlelement, mode);
+
+    }
+
+    void AsteroidMinable::registerVariables(){
+
+        registerVariable(this->size, VariableDirection::ToClient);
+        registerVariable(this->generateSmaller, VariableDirection::ToClient);
+        registerVariable(this->dropStuff, VariableDirection::ToClient); 
+        registerVariable(this->initialised, VariableDirection::ToClient);
+
+    }
+
+    void AsteroidMinable::tick(float dt){
+
+        if(!(this->initialised)){this->putStuff();} 
+
+        if(this->health_ <=0){this->death();}
+
+    }
+
+    void AsteroidMinable::death(){ // @brief Überschreibt die Methode in Pawn
+
+        // just copied that from somewhere else. 
+        this->bAlive_ = false;
+        this->destroyLater();
+        this->setDestroyWhenPlayerLeft(false);
+        // pawn -> addExplosionPart
+        // this->goWithStyle();
+
+
+        // Pickups which can be harvested. It's munition at the moment, could be changed/extended. 
+        if(dropStuff){
+            PickupSpawner* thingy = new PickupSpawner(this->context);
+
+            char tname[] = ""; // can-t overwrite strings easily in C (strcat etc.)
+            if(this->size <= 5){
+                strcat(tname, "smallmunitionpickup");
+            }else if(this->size <= 20){
+                strcat(tname, "mediummunitionpickup");
+            }else{
+                strcat(tname, "hugemunitionpickup");
+            }
+            thingy->setPickupTemplateName(tname);
+            thingy->setPosition(this->getPosition());
+            thingy->setMaxSpawnedItems(1); // Would be default anyways
+            thingy->setRespawnTime(0.2f);
+        }
+
+        // Smaller Parts = 'Children'
+        if(this->generateSmaller){this->spawnChildren();}
+
+    }
+
+// @brief If the option generateSmaller is enabled, individual fragments are added with this method. 
+    void AsteroidMinable::spawnChildren(){
+
+    if (this->size <=1){return;} // Absicherung trivialer Fall
+
+    int massRem = this->size-1; //some mass is lost
+    int num = round(rnd()*(massRem-1)) + 1; // random number of children, at least one
+    if(num > 10){num = 10;} // no max function in C? 
+    int masses[num]; // Masses of the asteroids
+    // orxout() << "SpawnChildren(): Passed basic stuff. num = " << num << "; massRem(total) = "<< massRem << endl;
+    massRem = massRem-num; // mass must be at least one, add later.  
+
+    // Randomnised spawning points for the new asteroids
+    float phi[num]; 
+    float theta[num]; 
+
+    // Discusting C stuff -> use that to initialise dynamic array values to 0. 
+    for(int twat = 0; twat<num; ++twat){masses[twat] = 0; phi[twat] = 0.0; theta[twat] = 0.0;}
+
+    float piG = 3.1415927410125732421875; //pi; // Math.pi ist statisch oder so. 
+    float d_p = 2*piG/num;
+    float d_t = piG/num;
+    float p = d_p/2.0;
+    float t = d_t/2.0;
+    // float phiOffset = rnd()*2*pi; // Added everywhere to become independent of the coordinate system?
+    // float thetaOffset = rnd()*pi;
+    float rScaling; // scale radius to prevent asteroids from touching. (distance=AsteroidRadius/tan(sector/2))
+
+    if(num == 1 ){
+        rScaling = 1; // avoid tan(90). Unused. 
+    }else{
+
+        rScaling = tan(t); 
+
+        int pos; // insert at random position (linear probing) in array, to get some randomness.  
+        for(int it = 0; it<num; ++it){
+
+            pos = mod((int)(rnd()*num),num); 
+            while(phi[pos] != 0.0){// find empty spot in array
+                pos = (int)mod(++pos, num);
+            }
+            phi[pos] = p + it*d_p;// set angle there
+
+            pos = mod((int)(rnd()*num),num);
+            while(theta[pos] != 0.0){
+                pos = (int)mod(++pos, num);
+            }
+            theta[pos] = t + it*d_t;
+        }
+    }
+
+    //orxout() << "SpawnChildren(): Phi: "; printArrayString(phi);
+    //orxout() << "SpawnChildren(): Theta: "; printArrayString(theta);
+    //orxout() << "SpawnChildren(): Passed angle stuff. " << endl;
+
+    // Triangular, discrete probability "density" with max at the average value massRem/num. 50% chance to be below that. 
+    if(massRem>0){
+        int c = massRem;
+        float probDensity[c];
+
+        int a = round(massRem/num);
+        int b = c-a;
+        
+        int z = 0;
+        float dProbA = 1.0/(a*a + 3.0*a + 2.0); // one 'probability unit' for discrete ramp function. Gauss stuff. 
+        for(z = 0; z<=a; ++z){probDensity[z] = (z+1)*dProbA; } // rising part
+
+        float dProbB = 1.0/(b*b +3.0*b + 2.0);
+        for(z = 0; z<b; ++z){probDensity[c-z] = (z+1)*dProbB;} // falling part
+    
+        // // Just for testing:
+        // float sum = 0.0;
+        // for(int globi = 0; globi<c; ++globi){
+        //     orxout() << "pDensity at [" << globi << "] is: " << probDensity[globi] << endl;
+        //     sum = sum+ probDensity[globi];
+        // }
+        // orxout() << "Sum of densities should b 1, it is: " << sum << endl;
+
+        // Distributing the mass to individual asteroids
+        int result; 
+        float rVal; // between 0 and 1
+        float probSum; // summing up until rval is reached. 
+        for(int trav = 0; trav<num; ++trav){
+            result = 0;
+            rVal = rnd(); 
+            probSum = probDensity[0]; 
+
+            while(rVal>probSum && result<massRem){// Not yet found && there-s smth left to distribute (Incrementing inside!)
+                if(result<(massRem-2)){probSum = probSum + probDensity[result+1];} // avoid logical/acess error
+                ++result;
+            }
+
+            masses[trav] = 1 +result; // Fragments have mass of at least one. 
+            massRem = massRem-result;
+
+        }
+    }else{
+        for(int schnaegg = 0; schnaegg<num; ++schnaegg){masses[schnaegg] = 1;}
+    }
+
+    // orxout() << "SpawnChildren(): Masses: "; printArrayString(masses);
+    // orxout() << "SpawnChildren(): Passed mass stuff. " << endl;
+
+    // Creating the 'chlidren':
+    for(int fisch = 0; fisch<num; ++fisch){
+
+        Vector3* pos = new Vector3(0,0,0); // Position offset
+        if(num > 1){// not required if there-s just one child
+            float r = masses[fisch]/rScaling;
+            pos = new Vector3(r*sin(theta[fisch])*cos(phi[fisch]), r*sin(theta[fisch])*sin(phi[fisch]), r*cos(theta[fisch])); // convert spheric coordinates to vector
+        }
+        
+        AsteroidMinable* child = new AsteroidMinable(this->context, masses[fisch], this->getPosition() + *pos, this->dropStuff);
+        child->setVelocity(this->getVelocity());
+
+        if(child == nullptr){
+            orxout(internal_error, context::pickups) << "Weird, can't create new AsteroidMinable." << endl;
+        }
+
+    }
+    // orxout() << "Leaving spawnChildren() method. " << endl;
+}
+
+// @brief overloading that to prevent asteroids from taking damage from each other (domino effect etc. ) 
+    void AsteroidMinable::hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage){
+
+        // orxout() << "AsteroidMining::Hit(Variante 1) Dings aufgerufen. " << endl; 
+        if(orxonox_cast<AsteroidMinable*>(originator) || orxonox_cast<Pickup*>(originator)){return;}
+        this->damage(damage, healthdamage, shielddamage, originator, cs);
+        this->setVelocity(this->getVelocity() + force);
+
+        // if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))// && (!this->getController() || !this->getController()->getGodMode()) )
+        // {
+        //     this->damage(damage, healthdamage, shielddamage, originator, cs);
+        //     this->setVelocity(this->getVelocity() + force);
+        // }
+    }
+
+// @brief overloading that to prevent asteroids from taking damage from each other (domino effect etc. ) 
+    void AsteroidMinable::hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage, float shielddamage){
+
+        //orxout() << "AsteroidMining::Hit(Variante 2) Dings aufgerufen. " << endl;
+        if(orxonox_cast<AsteroidMinable*>(originator) || orxonox_cast<Pickup*>(originator)){return;}
+        this->damage(damage, healthdamage, shielddamage, originator, cs);
+
+        // if (this->getGametype() && this->getGametype()->allowPawnHit(this, originator))// && (!this->getController() || !this->getController()->getGodMode()) )
+        // {
+        //     this->damage(damage, healthdamage, shielddamage, originator, cs);
+
+        //     //if ( this->getController() )
+        //     //    this->getController()->hit(originator, contactpoint, damage); // changed to damage, why shielddamage?
+        // }
+    }
+
+    // @brief Just for testing. Don-t work anyways. 
+    void AsteroidMinable::printArrayString(float thingy[]){ // Don-t work!
+
+        orxout() << "[" ; //<< endl;  
+        char frag[] = "";
+        int len = (int)(sizeof(thingy)/sizeof(thingy[0]));
+        for(int m = 0; m< (len-2); ++m){
+            sprintf(frag, "%.5f, ", thingy[m]);
+            orxout() << frag << endl;//std::flush;
+        }
+        sprintf(frag, "%.5f]", thingy[len-1]);
+        orxout() << frag << endl; // Just print it here! No ugly passing. 
+    }
+
+    // @brief Just for testing. Don-t work anyways. 
+    void AsteroidMinable::printArrayString(int thingy[]){
+
+        orxout() << "[" ; //<< endl; 
+        char frag[] = "";
+        int len = (int)(sizeof(thingy)/sizeof(thingy[0]));
+        for(int m = 0; m< (len-2); ++m){
+            sprintf(frag, "%.0i, ", thingy[m]);
+            orxout() << frag << endl;//std::flush;
+            printf("TEst");
+        }
+
+        sprintf(frag, "%.0i]", thingy[len-1]); // last element
+        orxout() << frag << endl; // Just print it here! No ugly passing. 
+    }
+
+    // void AsteroidMinable::printArrayString(int thingy[]){
+    //     char res[] = "[";
+    //     //strcat(res, "[");
+    //     char frag[] = "";
+
+    //     int len = (int)(sizeof(thingy)/sizeof(thingy[0]));
+    //     for(int m = 0; m< (len-1); ++m){
+    //         sprintf(frag, "%.0i, ", thingy[m]);
+    //         strcat(res, frag);
+    //     }
+    //     sprintf(frag, "%.0i]", thingy[len]);
+    //     strcat(res, frag); // last element
+
+    //     orxout() << res << endl; // Just print it here! No ugly passing. 
+
+    //     // static char result[(sizeof(res)/sizeof("")] = res; // define as static, would get deleted otherwise. 
+    //     // char *result = malloc(sizeof(res)/sizeof("") + 1); 
+    //     // *result = res;
+    //     // return result;
+    // }
+
+}
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.h
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.h	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/AsteroidMinable.h	(revision 11730)
@@ -0,0 +1,147 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+/**
+
+    @file
+    @author remartin
+    @brief An asteroid which can be destroyed. Some smaller asteroids are created and a pickup spawns. 
+
+HANDBUCH:
+o Die Collision Shape kann nur im Konstruktor hinzugefügt werden. Die XML-Argumente werden aber erst nach dem Konstruktor gesetzt. 
+  Darum wird hier beim ersten Aufruf der tick()-Methode via putStuff() ein komplett neuer Asteroid generiert und der alte zerstört. 
+o im Level-File includes/pickups.oxi importieren. 
+
+OFFEN/Weiterentwicklung: 
+o @TODO Add resource pickups. 
+--> data_extern/images/effects: PNG's für die Pickups
+--> https://www.orxonox.net/jenkins/view/Management/job/orxonox_doxygen_trunk/javadoc/group___pickup.html
+
+o Density doesn't add up to 1...
+o Does collision damage work properly
+o Add sound effect (crunching etc. ) (No sound in space...)
+o Explosion parts
+
+ANDERORTS VERÄNDERTE SACHEN: 
+Pickup-Zeug: 
+o Pickup.h: createSpawner() neu public statt private
+o PickupSpawner.h: Zugriffsrechte setPickupTemplateName() und setMaxSpawnedItems()
+o PickupSpawner.h: In Tick() zwei Testbedingungen eingefügt.
+o Pawn.h: Attribut acceptsPickups_ inklusive get/set. 
+
+ERLEGTE FEHLER:
+o Grössenabhängige Collision Shape -> putStuff-Methode, Werte noch nicht durchgesickert. 
+o setHealth: maxHealth() des pawns setzen! 
+o Asteroiden fressen Pickups: Argument in Pawn, Test darauf in Tick() von PickupSpawner. 
+o i++ einfach ganz verhindern, ++i stattdessen. 
+o Velocity didn-t get passed properly through the 2nd constructor. Used get/set instead. 
+o Rand() geht bis zu riesigen Nummern! rnd() ist zwischen 0 und 1
+
+NOTIZEN:
+o SUPER
+o Warnungsverhinderung anderswo: (void)pickedUp; // To avoid compiler warning.
+o friend class Pickupable;
+
+*/
+
+#ifndef _AsteroidMinable_H__
+#define _AsteroidMinable_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <vector>
+#include "interfaces/PickupCarrier.h"
+#include "interfaces/RadarViewable.h"
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/ExplosionPart.h"
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+
+namespace orxonox{
+
+
+    class _OrxonoxExport AsteroidMinable : public Pawn{ 
+
+        public:
+            // @brief This constructor is for XML access only!
+            AsteroidMinable(Context* context);
+            // @brief Call this Constructor from other C-files.
+            AsteroidMinable(Context* c, float size, Vector3 position, bool dS);
+
+            virtual ~AsteroidMinable();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
+            virtual void tick(float dt) override;
+
+            // @brief overloading that to prevent asteroids from taking damage from each other (domino effect etc. ) 
+            virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
+            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
+
+            inline void setSize(int s){this->size = s;}
+            inline int getSize(){return this->size;}
+
+            inline void toggleShattering(bool b){this->generateSmaller = b;}
+            inline bool doesShatter(){return this->generateSmaller;}
+
+            inline void toggleDropStuff(bool b){this->dropStuff = b;}
+            inline bool doesDropStuff(){return this->dropStuff;}
+
+        protected:
+
+            Context* context;
+
+            int size; //!< Implies health and type of dropped pickups
+            bool generateSmaller; //!< Whether this asteroid leaves fragments
+            bool dropStuff; //!< Whether this asteroid yields valuable stuff
+
+            // @brief Überschreibt die Methode in Pawn
+            virtual void death(); 
+
+        private:
+
+            bool initialised; //!< Used in relation to the constructor detour described above 
+
+            void registerVariables();
+
+            // @brief Helper method. 
+            virtual void putStuff();
+
+            // @brief If the option generateSmaller is enabled, individual fragments are added with this method. 
+            virtual void spawnChildren();
+
+            // @brief Just for testing. Don-t work anyways. 
+            void printArrayString(float thingy[]);
+            // @brief Just for testing. Don-t work anyways. 
+            void printArrayString(int thingy[]);
+
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _AsteroidMinable_H__ */
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/CMakeLists.txt
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/CMakeLists.txt	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/CMakeLists.txt	(revision 11730)
@@ -0,0 +1,19 @@
+SET_SOURCE_FILES(PICKUP_SRC_FILES
+  AsteroidMinable.cc
+  SpicedAsteroidField.cc
+  SpicedAsteroidBelt.cc
+)
+
+ORXONOX_ADD_LIBRARY(asteroidmining
+  MODULE
+  FIND_HEADER_FILES
+  TOLUA_FILES
+
+  PCH_FILE
+
+  LINK_LIBRARIES
+    overlays
+    orxonox
+    pickup
+  SOURCE_FILES ${PICKUP_SRC_FILES}
+)
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.cc
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.cc	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.cc	(revision 11730)
@@ -0,0 +1,179 @@
+
+ /*   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Simon Miescher
+ *
+ */
+
+/**
+
+    @file 
+    @author remartin
+    @brief Asteroid belt with lots of parameters. Derived from asteroidField.lua
+
+    Generates a ring of asteroids by calling SpicedAsteroidField multiple times. 
+    It's in the xy-plane at default, orientation can be changed with tiltAt 
+    (angle where it gets elevated/lowered the most) and TiltBy (angle at z-axis). 
+    This doesn't work very well and could probably implemented differently with 
+    relative coordinates (attach etc, stuff in WorldEntity). 
+
+    It is required to wait until all XML-arguments are set. That's why the actual 
+    generation happens when tick() gets called for the first time. 
+    
+*/
+
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+#include "../../orxonox/worldentities/WorldEntity.h"
+
+#include "SpicedAsteroidBelt.h"
+#include "SpicedAsteroidField.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "network/NetworkFunction.h"
+#include "util/Math.h"
+
+namespace orxonox{
+
+    RegisterClass(SpicedAsteroidBelt);
+
+    SpicedAsteroidBelt::SpicedAsteroidBelt(Context* context) : Pawn(context) {
+
+        RegisterObject(SpicedAsteroidBelt);
+
+        this->context = context; 
+
+        // Default Values:
+        this->count = 250; 
+        this->position = Vector3(0,0,0);
+        this->segments = 30;
+        this->minSize = 1;
+        this->maxSize = 50;
+        this->radius0 = 7190;
+        this->radius1 = 7800;
+
+        this->mDensity = 0.3;
+        this->fogDensity = 0.5;
+
+        this->tiltAt = 0.0; 
+        this->tiltBy = 0.0;  
+
+        this->registerVariables();
+
+    }
+
+    SpicedAsteroidBelt::~SpicedAsteroidBelt(){
+
+    }
+
+    void SpicedAsteroidBelt::create(){
+
+        float myPi = 3.1415927410125732421875; //pi; // Math.pi ist statisch oder so. 
+        float width = this->radius1 - this->radius0; if(width<0){width = -width;} // predefined abs?
+        float radius = (this->radius1 + this->radius0) / 2.0;
+        int segmentCount = round(this->count / this->segments);
+
+        SpicedAsteroidField* af[this->segments]; 
+        (void)af[0]; // avoid nasty compiler warning
+
+        float dPhi = (2 * myPi) / this->segments;
+        float dTheta = 4.0*this->tiltBy/this->segments; 
+        float sepp = -this->tiltAt;
+        float globi = (myPi/2.0) + this->tiltBy;
+
+        for(int s = 0; s<segments; ++s){
+            sepp = sepp + dPhi;
+            if(s<segments/2){            
+                globi = globi - dTheta; 
+            }else{
+                globi = globi + dTheta; 
+            }
+            
+            Vector3* pos = new Vector3(radius*cos(sepp)*sin(globi), radius*sin(sepp)*sin(globi), radius*cos(globi)); 
+            af[s] = new SpicedAsteroidField(this->context, this->position + *pos, this->minSize, this->maxSize, width, segmentCount, this->foggy, this->mDensity, this->fogDensity);
+            
+        }
+        
+    }
+
+    void SpicedAsteroidBelt::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+
+        SUPER(SpicedAsteroidBelt, XMLPort, xmlelement, mode); 
+
+        XMLPortParam(SpicedAsteroidBelt, "count", setCount, getCount, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "mDensity", setMineralDensity, getMineralDensity, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "position", setPosition, getPosition, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "segments", setSegments, getSegments, xmlelement, mode);
+
+        XMLPortParam(SpicedAsteroidBelt, "maxSize", setMaxSize, getMaxSize, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "minSize", setMinSize, getMinSize, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "radius0", setRadius0, getRadius0, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "radius1", setRadius1, getRadius1, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "foggy", setFog, isFoggy, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "fogDensity", setFogDensity, getFogDensity, xmlelement, mode);
+
+        XMLPortParam(SpicedAsteroidBelt, "tiltAt", setTiltAt, getTiltAt, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidBelt, "tiltBy", setTiltBy, getTiltBy, xmlelement, mode); 
+
+    }
+
+    void SpicedAsteroidBelt::XMLEventPort(Element& xmlelement, XMLPort::Mode mode){
+
+    }
+
+    void SpicedAsteroidBelt::registerVariables(){
+
+        registerVariable(this->count, VariableDirection::ToClient);
+        registerVariable(this->mDensity, VariableDirection::ToClient);
+        registerVariable(this->position, VariableDirection::ToClient);
+        registerVariable(this->segments, VariableDirection::ToClient);
+
+        registerVariable(this->maxSize, VariableDirection::ToClient);
+        registerVariable(this->minSize, VariableDirection::ToClient);
+        registerVariable(this->radius0, VariableDirection::ToClient);
+        registerVariable(this->radius1, VariableDirection::ToClient);
+        registerVariable(this->foggy, VariableDirection::ToClient);
+        registerVariable(this->fogDensity, VariableDirection::ToClient);
+
+        registerVariable(this->tiltAt, VariableDirection::ToClient);
+        registerVariable(this->tiltBy, VariableDirection::ToClient);
+
+    }
+
+    void SpicedAsteroidBelt::tick(float dt){
+
+        this->create();
+        this->bAlive_ = false;
+        this->destroyLater();
+
+    }
+
+}
+
+
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.h
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.h	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidBelt.h	(revision 11730)
@@ -0,0 +1,140 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *
+ */
+
+/**
+
+    @file 
+    @author remartin
+    @brief Asteroid belt with lots of parameters. Derived from asteroidField.lua
+
+    Generates a ring of asteroids by calling SpicedAsteroidField multiple times. 
+    It's in the xy-plane at default, orientation can be changed with tiltAt 
+    (angle where it gets elevated/lowered the most) and TiltBy (angle at z-axis). 
+    This doesn't work very well and could probably implemented differently with 
+    relative coordinates (attach etc, stuff in WorldEntity). 
+
+    It is required to wait until all XML-arguments are set. That's why the actual 
+    generation happens when tick() gets called for the first time. 
+    
+*/
+
+
+#ifndef _SpicedAsteroidBelt_H__
+#define _SpicedAsteroidBelt_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <vector>
+#include "worldentities/ControllableEntity.h"
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+
+namespace orxonox // tolua_export
+{
+
+    // tolua_export
+    class _OrxonoxExport SpicedAsteroidBelt : public Pawn // need pawn to get tick for clean argument passing
+    { // tolua_export
+
+        public:
+            SpicedAsteroidBelt(Context* context);// This constructor is for XML access only!
+
+            virtual ~SpicedAsteroidBelt();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
+            virtual void tick(float dt) override;
+
+
+            inline void setCount(float s){this->count = s;}
+            inline float getCount(){return this->count;}
+
+            inline void setMineralDensity(float d){this->mDensity = d;}
+            inline float getMineralDensity(){return this->mDensity;}
+
+            inline void setPosition(Vector3 v){this->position = v;}
+            inline Vector3 getPosition(){return this->position;}
+
+            inline void setSegments(int s){this->segments = s;}
+            inline int getSegments(){return this->segments;}
+
+            inline void setMaxSize(int i){this->maxSize = i;}
+            inline int getMaxSize(){return this->maxSize;}
+
+            inline void setMinSize(int i){this->minSize = i;}
+            inline int getMinSize(){return this->minSize;}
+
+            inline void setRadius0(float r0){this->radius0 = r0;}
+            inline int getRadius0(){return this->radius0;}
+
+            inline void setRadius1(float r1){this->radius1 = r1;}
+            inline int getRadius1(){return this->radius1;}            
+
+            inline void setFog(bool f){this->foggy = f;}
+            inline bool isFoggy(){return this->foggy;}
+
+            inline void setFogDensity(float fd){this->fogDensity = fd;}
+            inline float getFogDensity(){return this->fogDensity;}
+
+            inline void setTiltAt(float ta){this->tiltAt = ta;}
+            inline void setTiltBy(float tb){this->tiltBy = tb;}
+            inline float getTiltAt(){return this->tiltAt;}
+            inline float getTiltBy(){return this->tiltBy;}
+
+
+        protected:
+
+            Context* context;
+
+            float count; //!< Approximate number of asteroids
+            float mDensity; //!< Approximate commonness of asteroids that yield stuff, value between 0 and 1;
+
+            Vector3 position;
+
+            int segments; //!< Number of asteroidFields that get generated. 
+            
+            int maxSize; //!< Most obese asteroid possible
+            int minSize; //!< Most meagre asteroid possible
+
+            float radius0; //!< Inner radius
+            float radius1; //!< Outer radius
+
+            bool foggy; //!< Whether there's fog arount the asteroids
+            float fogDensity; 
+
+            float tiltAt; //!< Orientation: Angle where it gets elevated/lowered the most
+            float tiltBy; //!< angle at z-axis
+
+        private:
+            void registerVariables();
+            
+            virtual void create();
+
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _SpicedAsteroidBelt_H__ */
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.cc
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.cc	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.cc	(revision 11730)
@@ -0,0 +1,181 @@
+
+ /*   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Simon Miescher
+ *
+ */
+
+/**
+
+    @file 
+    @author remartin
+    @brief Asteroid field with lots of parameters. Derived from asteroidField.lua
+
+    Generates a bunch of asteroids that may contain some stuff. 
+    It is required to wait until all XML-arguments are set. That's why the actual 
+    generation happens when tick() gets called for the first time. 
+    
+*/
+
+
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+#include "../../orxonox/worldentities/WorldEntity.h"
+
+#include "SpicedAsteroidField.h"
+#include "AsteroidMinable.h"
+
+#include <algorithm>
+
+#include "core/CoreIncludes.h"
+#include "core/GameMode.h"
+#include "core/XMLPort.h"
+#include "core/EventIncludes.h"
+#include "network/NetworkFunction.h"
+#include "util/Math.h"
+
+#include "../../orxonox/graphics/Billboard.h"
+
+
+namespace orxonox{
+
+    RegisterClass(SpicedAsteroidField);
+
+    SpicedAsteroidField::SpicedAsteroidField(Context* context) : Pawn(context) {
+
+        RegisterObject(SpicedAsteroidField);
+        this->context = context;
+
+        // Default Values: 
+        this->count = 30; 
+        this->mDensity = 0.5;
+        this->position = Vector3(0,0,0);
+        this->maxSize = 40; 
+        this->minSize = 1; 
+        this->radius = 1000;
+        this->foggy = true; 
+        this->fogDensity = 0.5;
+
+        this->registerVariables();
+    }
+
+    SpicedAsteroidField::SpicedAsteroidField(Context* c, Vector3 p, int minS, int maxS, int w, int count, bool f, float mD, float fD): Pawn(c){
+
+        this->context = c;
+        this->position = p; 
+        this->minSize = minS; 
+        this->maxSize = maxS; 
+        this->radius = w; 
+        this->count = count; 
+        this->foggy = f; 
+
+        this->mDensity = mD;
+        this->fogDensity = fD; 
+
+    }
+
+
+    SpicedAsteroidField::~SpicedAsteroidField(){
+
+    }
+
+    void SpicedAsteroidField::create(){
+
+        int size;
+        int pX;
+        int pY;
+        int pZ;
+
+        Vector3* relPos; 
+
+        for(int gertrud = 0; gertrud<count; ++gertrud){
+
+            AsteroidMinable* a = new AsteroidMinable(this->context);
+
+            size = round(rnd()*(this->maxSize - this->minSize)) + this->minSize;
+            a->setSize(size); 
+
+            pX = round(rnd()*2*this->radius) - radius;
+            pY = round(rnd()*2*this->radius) - radius;
+            pZ = round(rnd()*2*this->radius) - radius;
+            relPos = new Vector3(pX, pY, pZ);
+            a->setPosition(this->position + *relPos);
+
+            bool spiced = (rnd() < (this->mDensity)); // Whether the asteroid does drop pickups etc. 
+            a->toggleDropStuff(spiced);
+            
+            a->setVelocity(this->getVelocity()); 
+            
+            // Fog is iplemented with billboards (as in asteroidField.lua, that bloke had the idea)
+            Billboard* bb;
+            if(this->foggy && mod(gertrud, 5) == 0){
+                bb = new Billboard(this->context);
+                bb->setPosition(this->position + *relPos);
+                bb->setMaterial("Smoke/Smoke");
+                bb->setScale(size);
+                bb->setColour(ColourValue(this->fogDensity, this->fogDensity, this->fogDensity));    
+            }
+        }
+    }
+
+    void SpicedAsteroidField::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+
+        SUPER(SpicedAsteroidField, XMLPort, xmlelement, mode); 
+
+        XMLPortParam(SpicedAsteroidField, "count", setCount, getCount, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "mDensity", setMineralDensity, getMineralDensity, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "position", setPosition, getPosition, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "maxSize", setMaxSize, getMaxSize, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "minSize", setMinSize, getMinSize, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "radius", setRadius, getRadius, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "foggy", setFog, isFoggy, xmlelement, mode);
+        XMLPortParam(SpicedAsteroidField, "fogDensity", setFogDensity, getFogDensity, xmlelement, mode);
+
+    }
+
+
+    void SpicedAsteroidField::XMLEventPort(Element& xmlelement, XMLPort::Mode mode){
+
+    }
+
+    void SpicedAsteroidField::registerVariables(){
+
+        registerVariable(this->count, VariableDirection::ToClient);
+        registerVariable(this->mDensity, VariableDirection::ToClient);
+        registerVariable(this->position, VariableDirection::ToClient);
+        registerVariable(this->maxSize, VariableDirection::ToClient);
+        registerVariable(this->minSize, VariableDirection::ToClient);
+        registerVariable(this->radius, VariableDirection::ToClient);
+        registerVariable(this->foggy, VariableDirection::ToClient);
+        registerVariable(this->fogDensity, VariableDirection::ToClient);
+
+    }
+
+    void SpicedAsteroidField::tick(float dt){
+
+        this->create();
+        this->bAlive_ = false;
+        this->destroyLater();
+    }
+
+}
Index: /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.h
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.h	(revision 11730)
+++ /code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.h	(revision 11730)
@@ -0,0 +1,118 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *
+ */
+
+/**
+
+    @file 
+    @author remartin
+    @brief Asteroid field with lots of parameters. Derived from asteroidField.lua
+
+    Generates a bunch of asteroids that may contain some stuff. 
+    It is required to wait until all XML-arguments are set. That's why the actual 
+    generation happens when tick() gets called for the first time. 
+    
+*/
+
+#ifndef _SpicedAsteroidField_H__
+#define _SpicedAsteroidField_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+#include <vector>
+
+#include "worldentities/ControllableEntity.h"
+#include "../../orxonox/worldentities/pawns/Pawn.h"
+
+namespace orxonox // tolua_export
+{
+
+    // tolua_export
+    class _OrxonoxExport SpicedAsteroidField : public Pawn // need pawn to get tick for clean argument passing
+    { // tolua_export
+
+        public:
+            SpicedAsteroidField(Context* context);// This constructor is for XML access only!
+            SpicedAsteroidField(Context* c, Vector3 p, int minS, int maxS, int w, int count, bool f, float mD, float fD); 
+
+            virtual ~SpicedAsteroidField();
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
+            virtual void tick(float dt) override;
+
+
+            inline void setCount(float s){this->count = s;}
+            inline float getCount(){return this->count;}
+
+            inline void setMineralDensity(float d){this->mDensity = d;}
+            inline float getMineralDensity(){return this->mDensity;}
+
+            inline void setPosition(Vector3 v){this->position = v;}
+            inline Vector3 getPosition(){return this->position;}
+
+            inline void setMaxSize(int i){this->maxSize = i;}
+            inline int getMaxSize(){return this->maxSize;}
+
+            inline void setMinSize(int i){this->minSize = i;}
+            inline int getMinSize(){return this->minSize;}
+
+            inline void setRadius(float r){this->radius = r;}
+            inline int getRadius(){return this->radius;}
+
+            inline void setFog(bool f){this->foggy = f;}
+            inline bool isFoggy(){return this->foggy;}
+
+            inline void setFogDensity(float fd){this->fogDensity = fd;}
+            inline float getFogDensity(){return this->fogDensity;}
+
+        protected:
+
+            Context* context;
+
+            float count; //!< Number of asteroids generated
+            float mDensity; //!< Mineral density, between 0 and 1;
+
+            Vector3 position; //!< The center
+            
+            int maxSize; //!< Upper bound to asteroid size 
+            int minSize; //!< Lower bound to asteroid size
+
+            float radius; //!< Asteroids can appear within a sphere. 
+            bool foggy; //!< Whether there's fog
+            float fogDensity; 
+
+
+        private:
+            void registerVariables();
+
+            virtual void create();
+
+
+    }; // tolua_export
+} // tolua_export
+
+#endif /* _SpicedAsteroidField_H__ */
Index: /code/branches/Presentation_HS17_merge/src/modules/pickup/Pickup.h
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/pickup/Pickup.h	(revision 11729)
+++ /code/branches/Presentation_HS17_merge/src/modules/pickup/Pickup.h	(revision 11730)
@@ -145,6 +145,9 @@
             virtual void changedPickedUp(void) override; //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
 
+
+            virtual bool createSpawner(void) override; //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
+
+
         protected:
-            virtual bool createSpawner(void) override; //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
 
             /**
Index: /code/branches/Presentation_HS17_merge/src/modules/pickup/PickupSpawner.cc
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/pickup/PickupSpawner.cc	(revision 11729)
+++ /code/branches/Presentation_HS17_merge/src/modules/pickup/PickupSpawner.cc	(revision 11730)
@@ -158,4 +158,6 @@
             for(Pawn* pawn : ObjectList<Pawn>())
             {
+                if(!(pawn->doesAcceptPickups())){continue;} // skip those pawns, e.g. AsteroidMinables. 
+
                 Vector3 distance = pawn->getWorldPosition() - this->getWorldPosition();
                 PickupCarrier* carrier = static_cast<PickupCarrier*>(pawn);
Index: /code/branches/Presentation_HS17_merge/src/modules/pickup/PickupSpawner.h
===================================================================
--- /code/branches/Presentation_HS17_merge/src/modules/pickup/PickupSpawner.h	(revision 11729)
+++ /code/branches/Presentation_HS17_merge/src/modules/pickup/PickupSpawner.h	(revision 11730)
@@ -114,4 +114,12 @@
                 {return this->pickupTemplate_; }
 
+
+            void setPickupTemplateName(const std::string& name);
+            void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
+
+            inline void setRespawnTime(float time)
+                { this->respawnTime_ = time; }
+
+
         private:
             void initialize(void);
@@ -141,10 +149,7 @@
             @param time New time after which this gets re-actived.
             */
-            inline void setRespawnTime(float time)
-                { this->respawnTime_ = time; }
 
-            void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
 
-            void setPickupTemplateName(const std::string& name);
+
             void setPickupTemplate(Template* temp);
 
Index: /code/branches/Presentation_HS17_merge/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- /code/branches/Presentation_HS17_merge/src/orxonox/worldentities/pawns/Pawn.cc	(revision 11729)
+++ /code/branches/Presentation_HS17_merge/src/orxonox/worldentities/pawns/Pawn.cc	(revision 11730)
@@ -84,4 +84,5 @@
         // set damage multiplier to default value 1, meaning nominal damage
         this->damageMultiplier_ = 1;
+        this->acceptsPickups_ = true;
 
         this->spawnparticleduration_ = 3.0f;
Index: /code/branches/Presentation_HS17_merge/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- /code/branches/Presentation_HS17_merge/src/orxonox/worldentities/pawns/Pawn.h	(revision 11729)
+++ /code/branches/Presentation_HS17_merge/src/orxonox/worldentities/pawns/Pawn.h	(revision 11730)
@@ -199,4 +199,9 @@
                 { return this->damageMultiplier_; }
 
+            // Some pawns can-t harvest pickups (e.g. AsteroidMinables). Checked in PickupSpawner. 
+            inline void setPickupAcceptance(bool b)
+                { this->acceptsPickups_ = b; }
+            inline bool doesAcceptPickups()
+                { return this->acceptsPickups_;}
 
             virtual void startLocalHumanControl() override;
@@ -218,5 +223,7 @@
                 { return this->weaponSystem_; }
 
-            static void consoleCommand_debugDrawWeapons(bool bDraw);
+            static void consoleCommand_debugDrawWeapons(bool bDraw); 
+
+
 
         protected:
@@ -256,4 +263,5 @@
 
             float damageMultiplier_; ///< Used by the Damage Boost Pickup.
+            bool acceptsPickups_; // Added for the asteroidMinable class, avoid that they attempt to grab the resources
 
             WeakPtr<Pawn> lastHitOriginator_;
