[11610] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
[11741] | 23 | * remartin |
---|
[11610] | 24 | * Co-authors: |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
[11664] | 28 | /** |
---|
| 29 | |
---|
[11667] | 30 | @file |
---|
| 31 | @author remartin |
---|
[11664] | 32 | @brief Asteroid field with lots of parameters. Derived from asteroidField.lua |
---|
| 33 | |
---|
[11667] | 34 | Generates a bunch of asteroids that may contain some stuff. |
---|
| 35 | It is required to wait until all XML-arguments are set. That's why the actual |
---|
| 36 | generation happens when tick() gets called for the first time. |
---|
| 37 | |
---|
[11664] | 38 | */ |
---|
| 39 | |
---|
[11610] | 40 | #ifndef _SpicedAsteroidField_H__ |
---|
| 41 | #define _SpicedAsteroidField_H__ |
---|
| 42 | |
---|
[11731] | 43 | #include "AsteroidMiningPrereqs.h" |
---|
[11610] | 44 | |
---|
[11736] | 45 | #include "core/BaseObject.h" |
---|
| 46 | #include "tools/interfaces/Tickable.h" |
---|
[11664] | 47 | |
---|
[11610] | 48 | namespace orxonox // tolua_export |
---|
| 49 | { |
---|
| 50 | |
---|
| 51 | // tolua_export |
---|
[11736] | 52 | class _AsteroidMiningExport SpicedAsteroidField : public BaseObject, public Tickable |
---|
[11610] | 53 | { // tolua_export |
---|
| 54 | |
---|
| 55 | public: |
---|
[11736] | 56 | SpicedAsteroidField(Context* context); |
---|
| 57 | virtual ~SpicedAsteroidField(); |
---|
[11610] | 58 | |
---|
| 59 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
| 60 | virtual void tick(float dt) override; |
---|
| 61 | |
---|
[11739] | 62 | inline void setCount(int s){this->count = s;} |
---|
| 63 | inline int getCount(){return this->count;} |
---|
[11610] | 64 | |
---|
[11615] | 65 | inline void setMineralDensity(float d){this->mDensity = d;} |
---|
| 66 | inline float getMineralDensity(){return this->mDensity;} |
---|
[11610] | 67 | |
---|
[11739] | 68 | inline void setPosition(const Vector3& v){this->position = v;} |
---|
| 69 | inline const Vector3& getPosition(){return this->position;} |
---|
[11610] | 70 | |
---|
[11739] | 71 | inline void setMaxSize(float i){this->maxSize = i;} |
---|
| 72 | inline float getMaxSize(){return this->maxSize;} |
---|
[11615] | 73 | |
---|
[11739] | 74 | inline void setMinSize(float i){this->minSize = i;} |
---|
| 75 | inline float getMinSize(){return this->minSize;} |
---|
[11615] | 76 | |
---|
| 77 | inline void setRadius(float r){this->radius = r;} |
---|
[11739] | 78 | inline float getRadius(){return this->radius;} |
---|
[11615] | 79 | |
---|
| 80 | inline void setFog(bool f){this->foggy = f;} |
---|
| 81 | inline bool isFoggy(){return this->foggy;} |
---|
| 82 | |
---|
[11640] | 83 | inline void setFogDensity(float fd){this->fogDensity = fd;} |
---|
| 84 | inline float getFogDensity(){return this->fogDensity;} |
---|
| 85 | |
---|
[11610] | 86 | protected: |
---|
[11664] | 87 | |
---|
[11739] | 88 | int count; //!< Number of asteroids generated |
---|
[11667] | 89 | float mDensity; //!< Mineral density, between 0 and 1; |
---|
[11615] | 90 | |
---|
[11667] | 91 | Vector3 position; //!< The center |
---|
[11640] | 92 | |
---|
[11739] | 93 | float maxSize; //!< Upper bound to asteroid size |
---|
| 94 | float minSize; //!< Lower bound to asteroid size |
---|
[11610] | 95 | |
---|
[11667] | 96 | float radius; //!< Asteroids can appear within a sphere. |
---|
| 97 | bool foggy; //!< Whether there's fog |
---|
[11739] | 98 | float fogDensity; |
---|
[11615] | 99 | |
---|
[11610] | 100 | |
---|
| 101 | private: |
---|
[11667] | 102 | virtual void create(); |
---|
| 103 | |
---|
| 104 | |
---|
[11610] | 105 | }; // tolua_export |
---|
| 106 | } // tolua_export |
---|
| 107 | |
---|
| 108 | #endif /* _SpicedAsteroidField_H__ */ |
---|