Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Limit turret's rotation (another method…), work a bit on the controller, and make a (ugly?) hack to allow attaching dynamic objects

File size: 2.6 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 *      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"
39#include "worldentities/pawns/Pawn.h"
40
41namespace orxonox
42{
43    class _ObjectsExport Turret : public Pawn
44    {
45        public:
46            Turret(Context* context);
47            virtual ~Turret();
48
49            virtual void rotatePitch(const Vector2& value);
50            virtual void rotateYaw(const Vector2& value);
51            virtual void rotateRoll(const Vector2& value);
52
53            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
54            virtual void tick(float dt);
55
56            virtual bool isInRange(Vector3 position);
57
58            inline void setMaxPitch(Ogre::Real pitch)
59                {this->maxPitch_ = pitch;}
60
61            inline Ogre::Real getMaxPitch()
62                {return this->maxPitch_;}
63
64            inline void setMaxYaw(Ogre::Real yaw)
65                {this->maxYaw_ = yaw;}
66
67            inline Ogre::Real getMaxYaw()
68                {return this->maxYaw_;}
69
70            inline void setAttackRadius(float radius)
71                {this->attackRadius_ = radius;}
72
73            inline float getAttackRadius()
74                {return this->attackRadius_;}
75
76
77        private:
78            bool gotOrient_;
79            Ogre::Real maxPitch_;
80            Ogre::Real maxYaw_;
81            float attackRadius_;
82            Quaternion startOrient_;
83            Vector3 startDir_;
84            Vector3 localZ_;
85            Vector3 localY_;
86            Vector3 localX_;
87            float rotationThrust_;
88
89            btVector3 localAngularAcceleration_;
90    };
91}
92
93#endif
94
Note: See TracBrowser for help on using the repository browser.