/* * 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 "AsteroidMiningPrereqs.h" #include "core/BaseObject.h" #include "tools/interfaces/Tickable.h" namespace orxonox // tolua_export { // tolua_export class _AsteroidMiningExport SpicedAsteroidField : public BaseObject, public Tickable { // tolua_export public: SpicedAsteroidField(Context* context); virtual ~SpicedAsteroidField(); virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); virtual void tick(float dt) override; inline void setCount(int s){this->count = s;} inline int getCount(){return this->count;} inline void setMineralDensity(float d){this->mDensity = d;} inline float getMineralDensity(){return this->mDensity;} inline void setPosition(const Vector3& v){this->position = v;} inline const Vector3& getPosition(){return this->position;} inline void setMaxSize(float i){this->maxSize = i;} inline float getMaxSize(){return this->maxSize;} inline void setMinSize(float i){this->minSize = i;} inline float getMinSize(){return this->minSize;} inline void setRadius(float r){this->radius = r;} inline float 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: int count; //!< Number of asteroids generated float mDensity; //!< Mineral density, between 0 and 1; Vector3 position; //!< The center float maxSize; //!< Upper bound to asteroid size float minSize; //!< Lower bound to asteroid size float radius; //!< Asteroids can appear within a sphere. bool foggy; //!< Whether there's fog float fogDensity; private: virtual void create(); }; // tolua_export } // tolua_export #endif /* _SpicedAsteroidField_H__ */