Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/input/src/orxonox/objects/SpaceShip.h @ 1519

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

moved input related files to src/core/input

  • Property svn:eol-style set to native
File size: 4.8 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 *      Benjamin Knecht
26 *
27 */
28
29#ifndef _SpaceShip_H__
30#define _SpaceShip_H__
31#include <string>
32#include "OrxonoxPrereqs.h"
33#include <OgrePrerequisites.h>
34
35#include "util/Math.h"
36#include "Camera.h"
37#include "Model.h"
38#include "tools/BillboardSet.h"
39
40namespace orxonox
41{
42    class _OrxonoxExport SpaceShip : public Model
43    {
44        public:
45
46            static SpaceShip *getLocalShip();
47
48            SpaceShip();
49            ~SpaceShip();
50            virtual bool create();
51            void registerAllVariables();
52            void init();
53            void setConfigValues();
54            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
55            virtual void tick(float dt);
56
57            void setCamera(const std::string& camera = "");
58            void setMaxSpeed(float value);
59            void setMaxSideAndBackSpeed(float value);
60            void setMaxRotation(float value);
61            void setTransAcc(float value);
62            void setRotAcc(float value);
63            void setTransDamp(float value);
64            void setRotDamp(float value);
65            void getFocus();
66
67            static std::string whereAmI();
68            static void setMaxSpeedTest(float value)
69                { SpaceShip::instance_s->setMaxSpeed(value); }
70
71            static void movePitch(float value);
72            static void moveYaw(float value);
73            static void moveRoll(float value);
74            static void moveLongitudinal(float value);
75            static void moveLateral(float value);
76            static void fire();
77            void setMovePitch(float value);
78            void setMoveYaw(float value);
79            void setMoveRoll(float value);
80            void setMoveLongitudinal(float value);
81            void setMoveLateral(float value);
82            void doFire();
83
84            float getMaxSpeed();
85            Vector3 getDir();
86            Vector3 getOrth();
87            Camera* getCamera();
88
89            int getTeamNr() const
90                { return this->teamNr_; }
91            int getHealth() const
92                { return this->health_; }
93
94            bool getMyShip(){return myShip_;}
95
96        protected:
97            void setTeamNr(int teamNr)
98                { this->teamNr_ = teamNr; }
99
100        private:
101            void createCamera();
102            virtual ColourValue getProjectileColour() const
103                { return ColourValue(1.0, 1.0, 0.5); }
104
105            Vector3 testvector_;
106            Vector3 initialDir_;
107            Vector3 currentDir_;
108            Vector3 initialOrth_;
109            Vector3 currentOrth_;
110            bool bInvertYAxis_;
111            bool setMouseEventCallback_;
112            bool bLMousePressed_;
113            bool bRMousePressed_;
114
115            Ogre::SceneNode* camNode_;
116            Camera* cam_;
117            std::string camName_;
118
119
120            ParticleInterface* tt_;
121
122            BillboardSet redBillboard_;
123            BillboardSet greenBillboard_;
124            Ogre::SceneNode* redNode_;
125            Ogre::SceneNode* greenNode_;
126            float blinkTime_;
127
128            BillboardSet crosshairNear_;
129            BillboardSet crosshairFar_;
130            Ogre::SceneNode* chNearNode_;
131            Ogre::SceneNode* chFarNode_;
132
133            float timeToReload_;
134            float reloadTime_;
135
136            float maxSideAndBackSpeed_;
137            float maxSpeed_;
138            float maxRotation_;
139            float translationAcceleration_;
140            float rotationAcceleration_;
141            float translationDamping_;
142            float rotationDamping_;
143
144            Radian maxRotationRadian_;
145            Radian rotationAccelerationRadian_;
146            Radian rotationDampingRadian_;
147            Radian zeroRadian_;
148            Radian mouseXRotation_;
149            Radian mouseYRotation_;
150
151            float mouseX_;
152            float mouseY_;
153
154            float emitterRate_;
155
156        protected:
157            bool myShip_;
158
159            int teamNr_;
160            int health_;
161
162            static SpaceShip* instance_s;
163    };
164}
165
166#endif /* _SpaceShip_H__ */
Note: See TracBrowser for help on using the repository browser.