Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/worldentities/pawns/ShootableObstacle.h @ 12252

Last change on this file since 12252 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
RevLine 
[11604]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    {
[11782]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;
[11604]44
[11782]45            inline void setCollisionDamage(float c)
46                    { this->collisionDamage_ = c; }
[11604]47
[11782]48            inline float getCollisionDamage()
49                { return this->collisionDamage_; }
[11604]50
[11782]51            inline void setEnableCollisionDamage(bool c)
52            {
53                this->enableCollisionDamage_ = c;
54                this->enableCollisionCallback();
55            }
[11604]56
[11782]57            inline bool getEnableCollisionDamage()
58                { return this->enableCollisionDamage_; }
[11604]59
[11782]60        private:
61            float collisionDamage_;
62            bool enableCollisionDamage_;
[11604]63    };
64}
65
[11782]66#endif
Note: See TracBrowser for help on using the repository browser.