/* * 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 ParticleProjectile.h @brief Definition of the ParticleProjectile class. */ #ifndef _BallProjectile_H__ #define _BallProjectile_H__ #include "weapons/WeaponsPrereqs.h" #include "weapons/projectiles/BillboardProjectile.h" namespace orxonox { /** @brief A projectile that is represented by particles. @author Fabian 'x3n' Landau @ingroup WeaponsProjectiles */ class _WeaponsExport BallProjectile : public BillboardProjectile { public: BallProjectile(Context* context); void Bounce(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs); virtual void setMaterial(const std::string& material) override; virtual void tick(float dt) override; void setSpeed(float speed); protected: bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs) override; private: void registerVariables(); void changeTexture(); float speed_; //!< The speed (in x-direction) of the ball. float fieldWidth_; //!< The width of the playing field. float fieldHeight_; //!< The height of the playing field. unsigned int textureIndex_; //!< The current index of the texture. (i.e. the index of the currently displayed texture) unsigned int maxTextureIndex_; //!< The maximal index. std::string materialBase_; //!< The base name of the material. }; } #endif /* _ParticleProjectile_H__ */