Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/turretFS14/src/modules/objects/Turret.h @ 10045

Last change on this file since 10045 was 10044, checked in by muemart, 11 years ago

Move everything back to the Turret class, set the correct team, and (re)arm the turret. Also, hide it from the radar.

File size: 2.7 KB
RevLine 
[9460]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 *      Marian Runo
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file Turret.h
31    @brief Definition of the Turret class.
32    @ingroup Objects
33*/
34
35#ifndef _Turret_H__
36#define _Turret_H__
37
38#include "objects/ObjectsPrereqs.h"
[10031]39#include "worldentities/pawns/Pawn.h"
[9460]40
41namespace orxonox
42{
[10021]43    class _ObjectsExport Turret : public Pawn
[9460]44    {
45        public:
[9667]46            Turret(Context* context);
[9460]47            virtual ~Turret();
48
49            virtual void rotatePitch(const Vector2& value);
[10004]50            virtual void rotateYaw(const Vector2& value);
51            virtual void rotateRoll(const Vector2& value);
[10044]52            virtual bool isInRange(const Vector3 &position);
53            virtual void aimAtPosition(const Vector3 &position);
[9460]54
[9469]55            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
[10004]56            virtual void tick(float dt);
[9460]57
[10044]58            inline void setAttackRadius(float radius)
59                { this->attackRadius_ = radius; }
[10031]60
[10044]61            inline void setMaxPitch(float pitch)
62                { this->maxPitch_ = pitch; }
63
64            inline void setMaxYaw(float yaw)
65                { this->maxYaw_ = yaw; }
66
67            inline float getAttackRadius() const
68                { return this->attackRadius_; }               
69
70            inline float getMaxPitch() const
71                { return this->maxPitch_; }
72
73            inline float getMaxYaw() const
74                { return this->maxYaw_; }
75
76        protected:
77            Vector3 startDir_;
78            Vector3 localZ_;
79            Vector3 localZStart_;
80            Vector3 localY_;
81            Vector3 localYStart_;
82            Vector3 localX_;
83            Vector3 localXStart_;           
84
[9460]85        private:
[10044]86            bool once_;
87
88            float attackRadius_;
89            Ogre::Real maxPitch_;
90            Ogre::Real maxYaw_;
[10021]91            float rotationThrust_;
[10018]92
[10044]93            Quaternion rotation_;
[9460]94    };
95}
96
97#endif
Note: See TracBrowser for help on using the repository browser.