/* * 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: * remartin * Co-authors: * */ /** @file @author remartin @brief Asteroid belt with lots of parameters. Derived from asteroidField.lua Generates a ring of asteroids by calling SpicedAsteroidField multiple times. It's in the xy-plane at default, orientation can be changed with tiltAt (angle where it gets elevated/lowered the most) and TiltBy (angle at z-axis). This doesn't work very well and could probably implemented differently with relative coordinates (attach etc, stuff in WorldEntity). 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 _SpicedAsteroidBelt_H__ #define _SpicedAsteroidBelt_H__ #include "AsteroidMiningPrereqs.h" #include "core/BaseObject.h" #include "tools/interfaces/Tickable.h" namespace orxonox // tolua_export { // tolua_export class _AsteroidMiningExport SpicedAsteroidBelt : public BaseObject, public Tickable { // tolua_export public: SpicedAsteroidBelt(Context* context);// This constructor is for XML access only! virtual ~SpicedAsteroidBelt(); virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 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(const Vector3& v){this->position = v;} inline const Vector3& getPosition(){return this->position;} inline void setSegments(int s){this->segments = s;} inline int getSegments(){return this->segments;} 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 setRadius0(float r0){this->radius0 = r0;} inline float getRadius0(){return this->radius0;} inline void setRadius1(float r1){this->radius1 = r1;} inline float getRadius1(){return this->radius1;} 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;} inline void setTiltAt(float ta){this->tiltAt = ta;} inline void setTiltBy(float tb){this->tiltBy = tb;} inline float getTiltAt(){return this->tiltAt;} inline float getTiltBy(){return this->tiltBy;} protected: float count; //!< Approximate number of asteroids float mDensity; //!< Approximate commonness of asteroids that yield stuff, value between 0 and 1; Vector3 position; int segments; //!< Number of asteroidFields that get generated. float maxSize; //!< Most obese asteroid possible float minSize; //!< Most meagre asteroid possible float radius0; //!< Inner radius float radius1; //!< Outer radius bool foggy; //!< Whether there's fog arount the asteroids float fogDensity; float tiltAt; //!< Orientation: Angle where it gets elevated/lowered the most float tiltBy; //!< angle at z-axis private: virtual void create(); }; // tolua_export } // tolua_export #endif /* _SpicedAsteroidBelt_H__ */