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/SpicedAsteroidBelt.h

    r11665 r11667  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
    2625 *
    2726 */
     
    2928/**
    3029
    31     @file SpicedAsteroidBelt.h
     30    @file
     31    @author remartin
    3232    @brief Asteroid belt with lots of parameters. Derived from asteroidField.lua
    3333
     34    Generates a ring of asteroids by calling SpicedAsteroidField multiple times.
     35    It's in the xy-plane at default, orientation can be changed with tiltAt
     36    (angle where it gets elevated/lowered the most) and TiltBy (angle at z-axis).
     37    This doesn't work very well and could probably implemented differently with
     38    relative coordinates (attach etc, stuff in WorldEntity).
    3439
     40    It is required to wait until all XML-arguments are set. That's why the actual
     41    generation happens when tick() gets called for the first time.
     42   
    3543*/
    3644
     
    7280            inline Vector3 getPosition(){return this->position;}
    7381
    74             // inline void setYaw(float y){this->yaw = y;}
    75             // inline float getYaw(){return this->yaw;}
    76 
    77             // inline void setPitch(float p){this->pitch = p;}
    78             // inline float getPitch(){return this->pitch;}
    79 
    8082            inline void setSegments(int s){this->segments = s;}
    8183            inline int getSegments(){return this->segments;}
     
    99101            inline float getFogDensity(){return this->fogDensity;}
    100102
     103            inline void setTiltAt(float ta){this->tiltAt = ta;}
     104            inline void setTiltBy(float tb){this->tiltBy = tb;}
     105            inline float getTiltAt(){return this->tiltAt;}
     106            inline float getTiltBy(){return this->tiltBy;}
     107
    101108
    102109        protected:
     
    104111            Context* context;
    105112
    106             float count;
    107             float mDensity; // Mineral density, between 0 and 1;
     113            float count; //!< Approximate number of asteroids
     114            float mDensity; //!< Approximate commonness of asteroids that yield stuff, value between 0 and 1;
    108115
    109116            Vector3 position;
    110117
    111             // float yaw;
    112             // float pitch;
    113             int segments;
     118            int segments; //!< Number of asteroidFields that get generated.
    114119           
    115             int maxSize;
    116             int minSize;
     120            int maxSize; //!< Most obese asteroid possible
     121            int minSize; //!< Most meagre asteroid possible
    117122
    118             float radius0;
    119             float radius1;
     123            float radius0; //!< Inner radius
     124            float radius1; //!< Outer radius
    120125
    121             bool foggy;
     126            bool foggy; //!< Whether there's fog arount the asteroids
    122127            float fogDensity;
    123128
    124             virtual void create();
     129            float tiltAt; //!< Orientation: Angle where it gets elevated/lowered the most
     130            float tiltBy; //!< angle at z-axis
    125131
    126132        private:
    127133            void registerVariables();
     134           
     135            virtual void create();
    128136
    129137    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.