/* * 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: * ... * */ #ifndef _AsteroidMinable_H__ #define _AsteroidMinable_H__ #include "OrxonoxPrereqs.h" #include #include #include "interfaces/PickupCarrier.h" #include "interfaces/RadarViewable.h" #include "worldentities/ControllableEntity.h" #include "worldentities/ExplosionPart.h" #include "../../orxonox/worldentities/pawns/Pawn.h" namespace orxonox { class _OrxonoxExport AsteroidMinable : public Pawn{ public: AsteroidMinable(Context* context);// @brief This constructor is for XML access only! AsteroidMinable(Context* c, float size, Vector3 position, Vector3 velocity, bool dS);// @brief Call this Constructor from other C-files. virtual ~AsteroidMinable(); virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; virtual void tick(float dt) override; // @brief Overwrite to prevet 'self-collision' of generated stuff virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); inline void setSize(int s){this->size = s;} inline int getSize(){return this->size;} inline void toggleShattering(bool b){this->generateSmaller = b;} inline void toggleDropStuff(bool b){this->dropStuff = b;} protected: Context* context; int size; bool generateSmaller; bool dropStuff; bool initialised; virtual void death(); private: void registerVariables(); virtual void spawnChildren(); virtual void putStuff(); // @brief Just for testing. Don-t work anyways. void printArrayString(float thingy[]); // @brief Just for testing. Don-t work anyways. void printArrayString(int thingy[]);// Just for testing }; // tolua_export } // tolua_export #endif /* _AsteroidMinable_H__ */