/* * 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 #include #include "worldentities/ControllableEntity.h" #include "../../orxonox/worldentities/pawns/Pawn.h" namespace orxonox // tolua_export { // tolua_export class _AsteroidMiningExport SpicedAsteroidField : public Pawn // need pawn to get tick for clean argument passing { // tolua_export public: SpicedAsteroidField(Context* context);// This constructor is for XML access only! SpicedAsteroidField(Context* c, Vector3 p, int minS, int maxS, int w, int count, bool f, float mD, float fD); virtual ~SpicedAsteroidField(); virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; virtual void tick(float dt) override; inline void setCount(float s){this->count = s;} inline float getCount(){return this->count;} inline void setMineralDensity(float d){this->mDensity = d;} inline float getMineralDensity(){return this->mDensity;} inline void setPosition(Vector3 v){this->position = v;} inline Vector3 getPosition(){return this->position;} inline void setMaxSize(int i){this->maxSize = i;} inline int getMaxSize(){return this->maxSize;} inline void setMinSize(int i){this->minSize = i;} inline int getMinSize(){return this->minSize;} inline void setRadius(float r){this->radius = r;} inline int 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: Context* context; float count; //!< Number of asteroids generated float mDensity; //!< Mineral density, between 0 and 1; Vector3 position; //!< The center int maxSize; //!< Upper bound to asteroid size int minSize; //!< Lower bound to asteroid size float radius; //!< Asteroids can appear within a sphere. bool foggy; //!< Whether there's fog float fogDensity; private: void registerVariables(); virtual void create(); }; // tolua_export } // tolua_export #endif /* _SpicedAsteroidField_H__ */