Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11664


Ignore:
Timestamp:
Dec 11, 2017, 6:05:17 PM (6 years ago)
Author:
remartin
Message:

SpicedAsteroidBelt erstellt, kosmetische Veränderungen. Offener Punkt um velocity, ansonsten fehlt nur noch das dokumentieren.

Location:
code/branches/AsteroidMining_HS17
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AsteroidMining_HS17/data/levels/AsteroidFarming.oxw

    r11646 r11664  
    1818?>
    1919
     20
    2021<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
     22
    2123
    2224<Level>
     
    3234    hasPhysics = true
    3335  >
     36
    3437
    3538  <?lua
     
    102105    <AsteroidMinable size=30 position="-100, -500, -100" velocity= "0, -30, 0"/>
    103106
    104     <!--- SpicedAsteroidField --->
    105     <SpicedAsteroidField count=30 mDensity= 0.5 maxSize=40 minSize=1 position="5000, 0, 0" radius=1000/>
     107    <!--- SpicedAsteroidField -->
     108    <SpicedAsteroidField count=30 mDensity= 0.5 maxSize=40 minSize=1 position="5000, 0, 0" radius=1000 velocity="-100,0,0"/>
     109
     110
     111    <!-- Asteroid Belt with a planet -->
     112    <SpicedAsteroidBelt position="-15000,0,0" mDensity=0.3 yaw=90 pitch=90 roll=90 segments=30 minSize=1 maxSize=50 radius0=7190 radius1 = 7800 count=250/>
     113    <Planet
     114      position="-15000,0,0"
     115      scale="5000"
     116      collisionType="dynamic"
     117      linearDamping="0.8"
     118      angularDamping="0"
     119      mass="10000000"
     120      pitch="0"
     121      mesh="planets/muunilinst.mesh"
     122      atmosphere="atmosphere1"
     123      rotationaxis="1,0,0"
     124      rotationrate="1.0"
     125      atmospheresize="80.0f"
     126      imagesize="1024.0f"
     127      collisiondamage = 2
     128      enablecollisiondamage = true
     129    >     
     130      <attached>
     131        <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
     132      </attached>
     133      <collisionShapes>
     134        <SphereCollisionShape radius="5000" position="0,0,0" />
     135      </collisionShapes>
     136    </Planet>
     137
     138
    106139
    107140
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/AsteroidMinable.cc

    r11641 r11664  
    2828
    2929/*
     30
     31    @file AsteroidMinable.cc
    3032
    3133*
     
    4547
    4648KNACKPUNKTE:
     49o Super-XML-Argumente werden nicht richtig geparst (Velocity, Pitch, Yaw etc. )
     50
    4751
    4852OFFEN:
     
    5862o Density doesn't add up to 1...
    5963o set collisionDamage? Just for static entities?
    60 o AsteroidBelt?
    6164
    6265o Dokumentieren mit @brief?
     
    6467o Add sound effect (crunching etc. ) (No sound in space...)
    6568o Explosion parts
    66 o custom HUD
    67 
    6869
    6970HANDBUCH:
     
    124125#include "util/Math.h"
    125126
    126 
    127 // #include "infos/PlayerInfo.h"
    128 // #include "controllers/Controller.h"
    129 // #include "gametypes/Gametype.h"
    130 // #include "graphics/ParticleSpawner.h"
    131 // #include "worldentities/ExplosionChunk.h"
    132 // #include "worldentities/ExplosionPart.h"
    133 
    134 // #include "core/object/ObjectListIterator.h"
    135 // #include "controllers/FormationController.h"
    136 
    137 #include "../pickup/items/HealthPickup.h"
    138127#include "../pickup/PickupSpawner.h"
    139128#include "../pickup/Pickup.h"
    140 //#include "../pickup/pickup ..... pickupable
     129
    141130#include "../objects/collisionshapes/SphereCollisionShape.h"
    142131#include "../../orxonox/graphics/Model.h"
    143132
    144133
    145 
    146 
    147 
    148 
    149 
    150 namespace orxonox
    151 {
     134namespace orxonox{
     135
    152136    RegisterClass(AsteroidMinable);
    153137
     
    156140
    157141        RegisterObject(AsteroidMinable);
    158 
    159142        this->context = context;
    160         this->initialised = false;
    161         this->dropStuff = true; // Default
     143
     144        // Default Values:
     145        this->size = 10;
     146        this->dropStuff = true;
     147        this->generateSmaller = true;
     148        this->health_ = 15*size;
     149        this->maxHealth_ = this->health_;
     150        this->acceptsPickups_ = false;
    162151
    163152        //Noetig, damit nicht sofort zerstoert?
    164153        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
     154        this->enableCollisionCallback();
     155
    165156
    166157        // Old from Pawn
    167158        this->registerVariables();
    168159
    169         //orxout() << "AsteroidMining:: Pseudo-Konstruktor passiert!" << endl;
     160        this->initialised = false;
    170161
    171162    }
     
    184175        }
    185176
    186         this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    187         this->enableCollisionCallback();
    188 
    189         // Default Values
    190177        this->context = c;
    191178        this->size = size;
     
    197184
    198185        this->setPosition(position);
    199         this->setVelocity(v); // velocity = v; // The right one?
    200         //this->roll = rand()*5; //etwas Drehung. richtige Variable
    201 
    202 
    203         // Add Model    //<Model position="0,-40,40" yaw="90" pitch="-90" roll="0" scale="4" mesh="ast6.mesh" />
     186        this->setVelocity(v);
     187        //this->roll = rand()*5; //etwas Drehung. Richtige Variable?
     188
     189        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
     190        this->enableCollisionCallback();
     191
     192
     193        // Add Model, random one of the 6 shapes
    204194        Model* hull = new Model(this->context);
    205         // random one of the 6 shapes
    206195        char meshThingy[] = "";
    207         sprintf(meshThingy, "ast%.0f.mesh", round(5*rnd())+1); //    sprintf(str, "Value of Pi = %f", M_PI);
     196        sprintf(meshThingy, "ast%.0f.mesh", round(5*rnd())+1);
    208197        hull->setMeshSource(meshThingy);
    209198        hull->setScale(this->size);
     
    212201        // Collision shape
    213202        SphereCollisionShape* cs = new SphereCollisionShape(this->context);
    214         cs->setRadius((this->size)*2); //OFFEN: Feinabstimmung der Radien. 2.5 in AsteroidField.lua
     203        cs->setRadius((this->size)*2); //OFFEN: Feinabstimmung der Radien.
    215204        this->attachCollisionShape(cs);
    216205
    217         // Old from Pawn
    218206        this->registerVariables();
    219207
    220208        this->initialised=true;
    221209
    222         //orxout() << "AsteroidMining:: Initialisierung Zweitkonstruktor abgeschlosssssen." << endl;
    223 
    224210    }
    225211
     
    227213
    228214    }
     215
    229216    // @brief Helper method. Create a new asteroid to have an appropriate size for the collision shape etc.
    230217    void AsteroidMinable::putStuff(){
     
    232219        // Just create a new asteroid to avoid Collision shape scale problems etc.
    233220        AsteroidMinable* reborn = new AsteroidMinable(this->context, this->size, this->getPosition(), this->getVelocity(), this->dropStuff);
    234         reborn->toggleShattering(true); // mainly here to avoid 'unused' warning.
     221        (void)reborn; // avoid compiler warning
    235222        this->bAlive_ = false;
    236223        this->destroyLater();
    237         //this->~AsteroidMinable(); // seems dangerous, yields warning.  Necessary for efficiency?
    238 
    239     }
    240 
    241     void AsteroidMinable::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    242     {
    243         SUPER(AsteroidMinable, XMLPort, xmlelement, mode);
    244         //        XMLPortParam(PickupSpawner, "pickup", setPickupTemplateName, getPickupTemplateName, xmlelement, mode);
     224
     225    }
     226
     227    void AsteroidMinable::XMLPort(Element& xmlelement, XMLPort::Mode mode){
     228
     229        SUPER(AsteroidMinable, XMLPort, xmlelement, mode);
     230
    245231        XMLPortParam(AsteroidMinable, "size", setSize, getSize, xmlelement, mode);
    246 
    247     }
    248 
    249     void AsteroidMinable::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
    250     {
     232        XMLPortParam(AsteroidMinable, "generateSmaller", toggleShattering, doesShatter, xmlelement, mode);
     233        XMLPortParam(AsteroidMinable, "dropStuff", toggleDropStuff, doesDropStuff, xmlelement, mode);
     234
     235    }
     236
     237    void AsteroidMinable::XMLEventPort(Element& xmlelement, XMLPort::Mode mode){
     238
    251239        SUPER(AsteroidMinable, XMLEventPort, xmlelement, mode);
    252240
    253         XMLPortEventState(AsteroidMinable, BaseObject, "vulnerability", setVulnerable, xmlelement, mode);
    254     }
    255 
    256     void AsteroidMinable::registerVariables()
    257     {
     241    }
     242
     243    void AsteroidMinable::registerVariables(){
    258244
    259245        registerVariable(this->size, VariableDirection::ToClient);
    260246        registerVariable(this->generateSmaller, VariableDirection::ToClient);
    261 
     247        registerVariable(this->dropStuff, VariableDirection::ToClient);
    262248        registerVariable(this->initialised, VariableDirection::ToClient);
    263249
    264             //         float size;
    265             // bool generateSmaller;
    266             // bool initialised;
    267 
    268             // Context* context;
    269     }
    270 
    271     void AsteroidMinable::tick(float dt)
    272     {
     250    }
     251
     252    void AsteroidMinable::tick(float dt){
     253
    273254        if(!(this->initialised)){this->putStuff();}
    274255
     
    277258    }
    278259
    279 
    280 
    281 
    282     void AsteroidMinable::death() //ueberschreiben
    283     {
    284 
    285         // orxout() << "AsteroidMinable::Death() aufgerufen." << endl;
    286 
    287         // OFFEN: Sauber kapputten
    288         // just copied other stuff:
    289         // this->setHealth(1);
     260    void AsteroidMinable::death(){ // ueberschreibt das Zeug in Pawn
     261
     262        // just copied that from somewhere else.
    290263        this->bAlive_ = false;
    291264        this->destroyLater();
     
    312285            thingy->setRespawnTime(0.2f);
    313286        }
    314         // orxout() << "AsteroidMining::Death(): Passed Pickup stuff!" << endl;
    315287
    316288        // Smaller Parts = 'Children'
    317289        if(this->generateSmaller){this->spawnChildren();}
    318290
    319         // orxout() << "Wieder retour in death() geschafft. " << endl;
    320 
    321291    }
    322292
     
    324294void AsteroidMinable::spawnChildren(){// Spawn smaller Children
    325295
    326    
    327296    if (this->size <=1){return;} // Absicherung trivialer Fall
    328297
     
    331300    if(num > 10){num = 10;} // no max function in C!
    332301    int masses[num]; // Masses of the asteroids, at least one.
    333     //orxout() << "SpawnChildren(): Passed basic stuff. num = " << num << "; massRem(total) = "<< massRem << endl;
     302
     303    // orxout() << "SpawnChildren(): Passed basic stuff. num = " << num << "; massRem(total) = "<< massRem << endl;
    334304
    335305    massRem = massRem-num; // mass is at least one, add again below.
    336306
    337307    // Randomnised spawning points for the new asteroids
    338     float phi[num]; // assuming that it gets initialised to 0. Add (= {0.0})?
    339     float theta[num];
     308    float phi[num];
     309    float theta[num];
     310
     311    // Discusting C stuff -> use that to initialise dynamic array values to 0.
     312    for(int twat = 0; twat<num; ++twat){masses[twat] = 0; phi[twat] = 0.0; theta[twat] = 0.0;}
     313
    340314    float piG = 3.1415927410125732421875; //pi; // Math.pi ist statisch oder so.
    341 
    342315    float d_p = 2*piG/num;
    343316    float d_t = piG/num;
     
    347320    // float thetaOffset = rnd()*pi;
    348321    float rScaling; // scale radius to prevent asteroids from touching. (distance=AsteroidRadius/tan(sector/2))
     322
    349323    if(num == 1 ){
    350324        rScaling = 1; // avoid tan(90). Unused.
     
    404378            result = 0;// reset
    405379            rVal = rnd();// between 0 and 1
    406             // orxout() << "Random Value picked: " << rVal << endl;
    407380            probSum = probDensity[0];
    408             //orxout() << "Sum at start: " << probSum << endl;
    409 
    410             while(rVal>probSum && result<massRem){// Not yet found && there-s smth to distribute (Incrementing once inside!)
     381
     382            while(rVal>probSum && result<massRem){// Not yet found && there-s smth left to distribute (Incrementing once inside!)
    411383                if(result<(massRem-2)){probSum = probSum + probDensity[result+1];} // avoid logical/acess error
    412384                ++result;
    413                 // orxout() << "Sum so far: " << probSum << ". Just added " << probDensity[result+1] <<  endl;
    414385            }
    415386
    416387            massRem = massRem-result;
    417             masses[trav] = 1 +result; // at least one
    418             // orxout() << "Mass chosen for child " << trav << " is: " << masses[trav] << endl;
    419 
    420         }
    421     }else{// Everyone has mass 1. Initialising the array to 1 doesn-t seem to work. Hideous C language!
    422         for(int schnaegg = 0; schnaegg<num; ++schnaegg){
    423             masses[schnaegg] = 1;
    424         }
     388            masses[trav] = 1 +result; // Fragments have mass of at least one.
     389        }
     390    }else{
     391        for(int schnaegg = 0; schnaegg<num; ++schnaegg){masses[schnaegg] = 1;}
    425392    }
    426393
     
    437404        }
    438405       
    439         // orxout() << "Creating asteroid with mass " << masses[fisch] << " at relative postition " << *pos << endl;
    440406        AsteroidMinable* child = new AsteroidMinable(this->context, masses[fisch], this->getPosition() + *pos, this->getVelocity(), this->dropStuff);
    441407
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/AsteroidMinable.h

    r11646 r11664  
    2626 *
    2727 */
     28
     29
     30/**
     31    @file AsteroidMinable.h
     32
     33
     34*/
    2835
    2936#ifndef _AsteroidMinable_H__
     
    6471
    6572            inline void toggleShattering(bool b){this->generateSmaller = b;}
     73            inline bool doesShatter(){return this->generateSmaller;}
     74
    6675            inline void toggleDropStuff(bool b){this->dropStuff = b;}
    67 
     76            inline bool doesDropStuff(){return this->dropStuff;}
    6877
    6978        protected:
     
    7483            bool generateSmaller;
    7584            bool dropStuff;
     85
    7686            bool initialised;
    7787
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/CMakeLists.txt

    r11640 r11664  
    22  AsteroidMinable.cc
    33  SpicedAsteroidField.cc
     4  SpicedAsteroidBelt.cc
    45)
    56
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.cc

    r11646 r11664  
    2727 */
    2828
    29 /*
     29/**
    3030
    31 *
    32 *
    33 *<OFFEN Describe
    34 Math from asteroidField.lua used.
    35 *
    36 *
    37 
    38 
    39 DESCRIPTION
    40 o Andere: Simpel wie in asteroidField.lua, oder einfach Asteroiden, die nichts abwerfen?
    41 --> Letzteres scheint passender, simpler.
     31    @file SpicedAsteroidField.cc
     32    @brief Asteroid field with lots of parameters. Derived from asteroidField.lua
    4233
    4334
     
    6051#include "util/Math.h"
    6152
    62 // #include "infos/PlayerInfo.h"
    63 // #include "controllers/Controller.h"
    64 // #include "gametypes/Gametype.h"
    65 // #include "graphics/ParticleSpawner.h"
    66 // #include "worldentities/ExplosionChunk.h"
    67 // #include "worldentities/ExplosionPart.h"
    68 
    69 // #include "core/object/ObjectListIterator.h"
    70 // #include "controllers/FormationController.h"
     53#include "../../orxonox/graphics/Billboard.h"
    7154
    7255
    73 //#include "../pickup/pickup ..... pickupable
    74 #include "../objects/collisionshapes/SphereCollisionShape.h"
    75 #include "../../orxonox/graphics/Model.h"
     56namespace orxonox{
    7657
    77 
    78 
    79 
    80 
    81 
    82 namespace orxonox
    83 {
    8458    RegisterClass(SpicedAsteroidField);
    8559
    8660    SpicedAsteroidField::SpicedAsteroidField(Context* context) : Pawn(context) {
    8761
    88         // Da auch noetig? Wegen set in XML-Code?
    8962        RegisterObject(SpicedAsteroidField);
     63        this->context = context;
    9064
    91         this->context = context;
     65        // Default Values:
     66        this->count = 30;
     67        this->mDensity = 0.5;
     68        this->position = Vector3(0,0,0);
     69        this->maxSize = 40;
     70        this->minSize = 1;
     71        this->radius = 1000;
    9272        this->foggy = true;
    9373        this->fogDensity = 0.5;
    94         this->count = 0;
    9574
    96         // Old from Pawn
    9775        this->registerVariables();
     76    }
    9877
     78    SpicedAsteroidField::SpicedAsteroidField(Context* c, Vector3 p, int minS, int maxS, int w, int count, bool f, float mD, float fD): Pawn(c){
    9979
    100         // this->create();
    101         this->bAlive_ = false;
    102         this->destroyLater();
     80        this->context = c;
     81        this->position = p;
     82        this->minSize = minS;
     83        this->maxSize = maxS;
     84        this->radius = w;
     85        this->count = count;
     86        this->foggy = f;
     87
     88        this->mDensity = mD;
     89        this->fogDensity = fD;
     90
    10391    }
     92
    10493
    10594    SpicedAsteroidField::~SpicedAsteroidField(){
     
    115104
    116105        Vector3* relPos;
     106
    117107
    118108        for(int gertrud = 0; gertrud<count; ++gertrud){
     
    131121            a->toggleDropStuff(spiced);
    132122
    133             // @TODO: Fox Fog stuff, error due to billbord
    134 
    135 //             Billboard* bb;
    136 //             if(this->foggy && mod(gertrud, 5) == 0){
    137 //                 bb = new Billboard(this->context);
    138 //                 bb->setPosition(this-position + *relPos);
    139 //                 bb->setMaterial("Smoke/Smoke");
    140 //                 bb->setScale(size); // tricky?
    141 
    142 //                 bb->setColour(ColourValue(this-fogDensity, this->fogDensity, this->fogDensity)); // 4rd argument = transparency?
    143                
    144 // //     print("<Billboard ")
    145 // //         print("position = \"")
    146 // //             print(posX) print(",")
    147 // //             print(posY) print(",")
    148 // //             print(posZ) print("\" ")
    149 // //         print("colour=\"")
    150 // //             print(brightness) print(",")
    151 // //             print(brightness) print(",")
    152 // //             print(brightness) print("\" ")
    153 // //         print("material=\"Smoke/Smoke\" scale=")
    154 // //         print(size)
    155 // //     print(" />")
    156 //             }
     123            // A problem
     124            a->setVelocity(this->getVelocity());
     125           
     126            // Fog is iplemented with billboards.
     127            Billboard* bb;
     128            if(this->foggy && mod(gertrud, 5) == 0){
     129                bb = new Billboard(this->context);
     130                bb->setPosition(this->position + *relPos);
     131                bb->setMaterial("Smoke/Smoke");
     132                bb->setScale(size);
     133                bb->setColour(ColourValue(this->fogDensity, this->fogDensity, this->fogDensity));   
     134            }
    157135        }
    158136    }
    159137
    160     void SpicedAsteroidField::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    161     {
    162         // SUPER(SpicedAsteroidField, XMLPort, xmlelement, mode);
    163         //        XMLPortParam(PickupSpawner, "pickup", setPickupTemplateName, getPickupTemplateName, xmlelement, mode);
     138    void SpicedAsteroidField::XMLPort(Element& xmlelement, XMLPort::Mode mode){
     139
     140        SUPER(SpicedAsteroidField, XMLPort, xmlelement, mode);
     141
    164142        XMLPortParam(SpicedAsteroidField, "count", setCount, getCount, xmlelement, mode);
    165143        XMLPortParam(SpicedAsteroidField, "mDensity", setMineralDensity, getMineralDensity, xmlelement, mode);
     
    174152
    175153
     154    void SpicedAsteroidField::XMLEventPort(Element& xmlelement, XMLPort::Mode mode){
    176155
    177 
    178     void SpicedAsteroidField::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
    179     {
    180         // SUPER(SpicedAsteroidField, XMLEventPort, xmlelement, mode);
    181 
    182         XMLPortEventState(SpicedAsteroidField, BaseObject, "vulnerability", setVulnerable, xmlelement, mode);
    183156    }
    184157
    185     void SpicedAsteroidField::registerVariables()
    186     {
     158    void SpicedAsteroidField::registerVariables(){
    187159
    188160        registerVariable(this->count, VariableDirection::ToClient);
     
    195167        registerVariable(this->fogDensity, VariableDirection::ToClient);
    196168
    197 
    198169    }
    199170
     
    201172
    202173        this->create();
    203         // orxout() << "SpicedAsteroidField is done. " << endl;
    204 
    205174        this->bAlive_ = false;
    206175        this->destroyLater();
    207176    }
    208177
    209 
    210 
    211 
    212 
    213178}
    214 
    215 // --[[ fog generator
    216 // generates fog
    217 //     posX, posY, posZ - position in space
    218 //     size - size of billboard
    219 //     brightness - [0,1] fog brightness
    220 // --]]
    221 // function generateFog(posX, posY, posZ, size, brightness)
    222 //     print("<Billboard ")
    223 //         print("position = \"")
    224 //             print(posX) print(",")
    225 //             print(posY) print(",")
    226 //             print(posZ) print("\" ")
    227 //         print("colour=\"")
    228 //             print(brightness) print(",")
    229 //             print(brightness) print(",")
    230 //             print(brightness) print("\" ")
    231 //         print("material=\"Smoke/Smoke\" scale=")
    232 //         print(size)
    233 //     print(" />")
    234 // end
    235 
    236 // --[[ asteroid field generator
    237 // generates asteroid field
    238 //     posX, posY, posZ - position in space
    239 //     minSize, maxSize - size boundaries of each asteroid
    240 //     radius - size of the cube around position in space
    241 //     count - number of asteroids
    242 //     fog - enable fog 0/1
    243 // --]]
    244 // function asteroidField(posX, posY, posZ, minSize, maxSize, radius, count, fog)
    245 //     for i = 1, count, 1 do
    246 //         size = (math.random() * (maxSize - minSize)) + minSize
    247 //         pX = (2 * math.random() * radius) - radius + posX
    248 //         pY = (2 * math.random() * radius) - radius + posY
    249 //         pZ = (2 * math.random() * radius) - radius + posZ
    250 //         print("<StaticEntity ")
    251 
    252 //         print("position = \"")
    253 //         print(pX) print(",")
    254 //         print(pY) print(",")
    255 //         print(pZ) print("\" ")
    256 
    257 //         print("scale = \"") print(size) print("\" ")
    258 
    259 //         print("collisionType = static linearDamping = 0.8 angularDamping = 1 ")
    260 //         print("collisiondamage = 1000 enablecollisiondamage = true>")
    261 
    262 //         print("<attached>")
    263 //             print("<Model mass=\"") print(size * 10) print("\" ")
    264 //             print("mesh=\"ast") print(math.mod(i,6) + 1) print(".mesh\" />")
    265 //         print("</attached>")
    266 
    267 //         print("<collisionShapes> ")
    268 //             print("<SphereCollisionShape radius=\"")
    269 //             print(size * 2.5) print("\" />")
    270 //         print("</collisionShapes>")
    271 
    272 //         print("</StaticEntity>")
    273 
    274 //         if fog == 1 and i % 5 == 0 then
    275 //             generateFog(pX, pY, pZ, radius*0.04, 0.2)
    276 //         end
    277 //     end
    278 // end
    279 
    280 
    281 // --[[ asteroid belt generator
    282 // generates asteroid belt
    283 //     posX, posY, posZ - position in space
    284 //     yaw, pitch - rotation
    285 //     minSize, maxSize - size boundaries of each asteroid
    286 //     radius0, radius1 - inner/outer radius
    287 //     count - number of asteroids
    288 //     fog - enable fog 0/1
    289 // --]]
    290 // function asteroidBelt(centerX, centerY, centerZ, yaw, pitch, segments, minSize, maxSize, radius0, radius1, count, fog)
    291 //     dPhi = (2 * math.pi) / segments
    292 //     width = math.abs(radius1 - radius0)
    293 //     radius = (radius1 + radius0) / 2
    294 //     segmentCount = count / segments
    295 
    296 //     print("<StaticEntity collisionType=static yaw=") print(yaw)
    297 //     print(" pitch=") print(pitch)
    298 
    299 //     print(" position = \"")
    300 //         print(centerX) print(",")
    301 //         print(centerY) print(",")
    302 //         print(centerZ) print("\"")
    303 //     print(">")
    304 
    305 //     print("<attached>")
    306 
    307 //     for i = 0, segments - 1, 1 do
    308 //         asteroidField((radius * math.cos(i * dPhi)),
    309 //                     (radius * math.sin(i * dPhi)),
    310 //                     0, minSize, maxSize, width, segmentCount, fog)
    311 //     end
    312 
    313 //     print("</attached>")
    314 //     print("</StaticEntity>")
    315 // end
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.h

    r11640 r11664  
    2727 */
    2828
     29/**
     30
     31    @file SpicedAsteroidField.h
     32    @brief Asteroid field with lots of parameters. Derived from asteroidField.lua
     33
     34
     35*/
     36
    2937#ifndef _SpicedAsteroidField_H__
    3038#define _SpicedAsteroidField_H__
     
    3442#include <string>
    3543#include <vector>
    36 #include "interfaces/PickupCarrier.h"
    37 #include "interfaces/RadarViewable.h"
     44
    3845#include "worldentities/ControllableEntity.h"
    39 #include "worldentities/ExplosionPart.h"
    40 
    4146#include "../../orxonox/worldentities/pawns/Pawn.h"
    4247
    4348namespace orxonox // tolua_export
    4449{
    45 
    4650
    4751    // tolua_export
     
    5155        public:
    5256            SpicedAsteroidField(Context* context);// This constructor is for XML access only!
     57            SpicedAsteroidField(Context* c, Vector3 p, int minS, int maxS, int w, int count, bool f, float mD, float fD);
    5358
    5459            virtual ~SpicedAsteroidField();
     
    8388
    8489        protected:
    85             // Da neue Argumente reinstellen
    86             //float asteroidVersion; // Bodenstrich-Konvention?,
    87             // Wert zwischen 1 und 6 (Spezialdinger?), die Mesh-Form
     90
     91            Context* context;
     92
    8893            float count;
    8994            float mDensity; // Mineral density, between 0 and 1;
    9095
    9196            Vector3 position;
    92             Context* context;
    9397           
    9498            int maxSize;
Note: See TracChangeset for help on using the changeset viewer.