Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/orxonox/objects/SpaceShip.h @ 1521

Last change on this file since 1521 was 1521, checked in by scheusso, 16 years ago

we are now able to define callback actions, for each seperate variable of a synchronisable, that has changed

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