Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/SpaceShip.h @ 2072

Last change on this file since 2072 was 2072, checked in by landauf, 16 years ago

changed svn:eol-style to native in all new files

  • Property svn:eol-style set to native
File size: 3.4 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 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _SpaceShip_H__
30#define _SpaceShip_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include "Pawn.h"
35
36namespace orxonox
37{
38    class _OrxonoxExport SpaceShip : public Pawn
39    {
40        public:
41            SpaceShip(BaseObject* creator);
42            virtual ~SpaceShip();
43
44            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
45            virtual void tick(float dt);
46            void registerVariables();
47            void setConfigValues();
48
49            virtual void moveFrontBack(const Vector2& value);
50            virtual void moveRightLeft(const Vector2& value);
51            virtual void moveUpDown(const Vector2& value);
52
53            virtual void rotateYaw(const Vector2& value);
54            virtual void rotatePitch(const Vector2& value);
55            virtual void rotateRoll(const Vector2& value);
56
57            virtual void fire();
58
59            void setMaxSpeed(float value)
60                { this->maxSpeed_ = value; }
61            void setMaxSecondarySpeed(float value)
62                { this->maxSecondarySpeed_ = value; }
63            void setMaxRotation(const Degree& value)
64                { this->maxRotation_ = value; }
65            void setTransAcc(float value)
66                { this->translationAcceleration_ = value; }
67            void setRotAcc(const Degree& value)
68                { this->rotationAcceleration_ = value; }
69            void setTransDamp(float value)
70                { this->translationDamping_ = value; }
71
72            inline float getMaxSpeed() const
73                { return this->maxSpeed_; }
74            inline float getMaxSecondarySpeed() const
75                { return this->maxSecondarySpeed_; }
76            inline float getMaxRotation() const
77                { return this->maxRotation_.valueDegrees(); }
78            inline float getTransAcc() const
79                { return this->translationAcceleration_; }
80            inline float getRotAcc() const
81                { return this->rotationAcceleration_.valueDegrees(); }
82            inline float getTransDamp() const
83                { return this->translationDamping_; }
84
85        protected:
86            bool bInvertYAxis_;
87
88            float maxSpeed_;
89            float maxSecondarySpeed_;
90            float translationAcceleration_;
91            float translationDamping_;
92
93            Degree maxRotation_;
94            Degree rotationAcceleration_;
95
96            Degree zeroDegree_;
97            Degree pitchRotation_;
98            Degree yawRotation_;
99            Degree rollRotation_;
100    };
101}
102
103#endif /* _SpaceShip_H__ */
Note: See TracBrowser for help on using the repository browser.