[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" |
---|
[10004] | 39 | #include "OgreQuaternion.h" |
---|
[9460] | 40 | |
---|
[9489] | 41 | #include "worldentities/pawns/SpaceShip.h" |
---|
[9460] | 42 | |
---|
| 43 | namespace orxonox |
---|
| 44 | { |
---|
[10021] | 45 | class _ObjectsExport Turret : public Pawn |
---|
[9460] | 46 | { |
---|
| 47 | public: |
---|
[9667] | 48 | Turret(Context* context); |
---|
[9460] | 49 | virtual ~Turret(); |
---|
| 50 | |
---|
| 51 | virtual void rotatePitch(const Vector2& value); |
---|
[10004] | 52 | virtual void rotateYaw(const Vector2& value); |
---|
| 53 | virtual void rotateRoll(const Vector2& value); |
---|
[9460] | 54 | |
---|
[9469] | 55 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
[10004] | 56 | virtual void tick(float dt); |
---|
[9460] | 57 | |
---|
[10018] | 58 | inline void setMaxPitch(Ogre::Real pitch) |
---|
| 59 | {this->maxPitch_ = pitch;} |
---|
[9460] | 60 | |
---|
[10018] | 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 | |
---|
[9460] | 70 | private: |
---|
[10004] | 71 | bool gotOrient_; |
---|
[10018] | 72 | Ogre::Real maxPitch_; |
---|
| 73 | Ogre::Real maxYaw_; |
---|
| 74 | Quaternion startOrientInv_; |
---|
[10021] | 75 | float rotationThrust_; |
---|
[10018] | 76 | |
---|
[10021] | 77 | btVector3 localAngularAcceleration_; |
---|
| 78 | |
---|
[10018] | 79 | Ogre::Real boundBetween(float val, float lowerBound, float upperBound); |
---|
[9460] | 80 | }; |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | #endif |
---|
| 84 | |
---|