Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/objects/worldentities/pawns/SpaceShip.h @ 2961

Last change on this file since 2961 was 2662, checked in by rgrieder, 16 years ago

Merged presentation branch back to trunk.

  • 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 "LinearMath/btVector3.h"
35
36#include "Pawn.h"
37
38namespace orxonox
39{
40    class _OrxonoxExport SpaceShip : public Pawn
41    {
42        public:
43            SpaceShip(BaseObject* creator);
44            virtual ~SpaceShip();
45
46            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
47            virtual void tick(float dt);
48            void registerVariables();
49            void setConfigValues();
50
51            virtual void moveFrontBack(const Vector2& value);
52            virtual void moveRightLeft(const Vector2& value);
53            virtual void moveUpDown(const Vector2& value);
54
55            virtual void rotateYaw(const Vector2& value);
56            virtual void rotatePitch(const Vector2& value);
57            virtual void rotateRoll(const Vector2& value);
58
59            virtual void fire();
60            virtual void boost();
61
62            void setEngine(Engine* engine);
63            inline Engine* getEngine() const
64                { return this->engine_; }
65
66            inline void setSteeringDirection(const Vector3& direction)
67                { this->steering_ = direction; }
68            inline const Vector3& getSteeringDirection() const
69                { return this->steering_; }
70
71            inline void setBoost(bool bBoost)
72                { this->bBoost_ = bBoost; }
73            inline bool getBoost() const
74                { return this->bBoost_; }
75
76            inline void setEngineTemplate(const std::string& temp)
77                { this->enginetemplate_ = temp; this->loadEngineTemplate(); }
78            inline const std::string& getEngineTemplate() const
79                { return this->enginetemplate_; }
80
81            inline void setPermanentBoost(bool bPermanent)
82                { this->bPermanentBoost_ = bPermanent; }
83            inline bool getPermanentBoost() const
84                { return this->bPermanentBoost_; }
85
86        protected:
87            bool bInvertYAxis_;
88
89            bool bBoost_;
90            bool bPermanentBoost_;
91            Vector3 steering_;
92            float primaryThrust_;
93            float auxilaryThrust_;
94            float rotationThrust_;
95            btVector3 localLinearAcceleration_;
96            btVector3 localAngularAcceleration_;
97
98        private:
99            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
100
101        private:
102            void loadEngineTemplate();
103
104            std::string enginetemplate_;
105            Engine* engine_;
106    };
107}
108
109#endif /* _SpaceShip_H__ */
Note: See TracBrowser for help on using the repository browser.