Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/OrxoKart_HS18/src/orxonox/worldentities/pawns/ShootableObstacle.h @ 12209

Last change on this file since 12209 was 11783, checked in by landauf, 7 years ago

merged Presentation_HS17_merge back to trunk

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Leon Rigoni
24 *
25 */
26#ifndef _ShootableObstacle_H__
27#define _ShootableObstacle_H__
28#include "worldentities/pawns/Pawn.h"
29
30namespace orxonox // tolua_export
31{
32    /**
33    @brief
34        This class encapsulates a pawn (so an object with health) with the addition, that it damages other objects when it hits them.
35    */
36
37    class _OrxonoxExport ShootableObstacle
38        : public Pawn
39    {
40        public:
41            ShootableObstacle(Context* context);
42            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
43            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) override;
44
45            inline void setCollisionDamage(float c)
46                    { this->collisionDamage_ = c; }
47
48            inline float getCollisionDamage()
49                { return this->collisionDamage_; }
50
51            inline void setEnableCollisionDamage(bool c)
52            {
53                this->enableCollisionDamage_ = c;
54                this->enableCollisionCallback();
55            }
56
57            inline bool getEnableCollisionDamage()
58                { return this->enableCollisionDamage_; }
59
60        private:
61            float collisionDamage_;
62            bool enableCollisionDamage_;
63    };
64}
65
66#endif
Note: See TracBrowser for help on using the repository browser.