Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 12, 2017, 8:29:52 PM (8 years ago)
Author:
remartin
Message:

Added tilting for the spicedAsteroidBelt. Finished commenting, polish up. Done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/SpicedAsteroidField.cc

    r11664 r11667  
    2929/**
    3030
    31     @file SpicedAsteroidField.cc
     31    @file
     32    @author remartin
    3233    @brief Asteroid field with lots of parameters. Derived from asteroidField.lua
    3334
    34 
     35    Generates a bunch of asteroids that may contain some stuff.
     36    It is required to wait until all XML-arguments are set. That's why the actual
     37    generation happens when tick() gets called for the first time.
     38   
    3539*/
    3640
     
    105109        Vector3* relPos;
    106110
    107 
    108111        for(int gertrud = 0; gertrud<count; ++gertrud){
    109112
     
    111114
    112115            size = round(rnd()*(this->maxSize - this->minSize)) + this->minSize;
    113             a->setSize(size);
     116            a->setSize(size);
     117
    114118            pX = round(rnd()*2*this->radius) - radius;
    115119            pY = round(rnd()*2*this->radius) - radius;
     
    118122            a->setPosition(this->position + *relPos);
    119123
    120             bool spiced = (rnd() < (this->mDensity)); // does drop pickups etc.
     124            bool spiced = (rnd() < (this->mDensity)); // Whether the asteroid does drop pickups etc.
    121125            a->toggleDropStuff(spiced);
    122 
    123             // A problem
    124             a->setVelocity(this->getVelocity());
    125126           
    126             // Fog is iplemented with billboards.
     127            a->setVelocity(this->getVelocity());
     128           
     129            // Fog is iplemented with billboards (as in asteroidField.lua, that bloke had the idea)
    127130            Billboard* bb;
    128131            if(this->foggy && mod(gertrud, 5) == 0){
Note: See TracChangeset for help on using the changeset viewer.