Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network3/src/orxonox/objects/SpaceShip.h @ 1212

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

merged camera branch changes from 1101 to 1202 into network branch (we have now a camera manager)

File size: 3.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
32#include "OrxonoxPrereqs.h"
33
34#include <OgrePrerequisites.h>
35#include <OIS/OISMouse.h>
36
37#include "Camera.h"
38#include "Model.h"
39#include "../tools/BillboardSet.h"
40
41
42namespace orxonox
43{
44    class _OrxonoxExport SpaceShip : public Model, public OIS::MouseListener
45    {
46        public:
47            SpaceShip();
48            ~SpaceShip();
49            bool create();
50            void registerAllVariables();
51            void init();
52            void setConfigValues();
53            virtual void loadParams(TiXmlElement* xmlElem);
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
66            static void setMaxSpeedTest(float value)
67                { SpaceShip::instance_s->setMaxSpeed(value); }
68
69            bool mouseMoved(const OIS::MouseEvent &e);
70            bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
71            bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);
72
73
74        private:
75            void createCamera();
76            static SpaceShip* instance_s;
77
78            Vector3 testvector_;
79            bool bInvertYAxis_;
80            bool setMouseEventCallback_;
81            bool bLMousePressed_;
82            bool bRMousePressed_;
83
84            Ogre::SceneNode* camNode_;
85            Camera* cam_;
86
87            ParticleInterface* tt_;
88
89            BillboardSet redBillboard_;
90            BillboardSet greenBillboard_;
91            Ogre::SceneNode* redNode_;
92            Ogre::SceneNode* greenNode_;
93            float blinkTime_;
94
95            BillboardSet crosshairNear_;
96            BillboardSet crosshairFar_;
97            Ogre::SceneNode* chNearNode_;
98            Ogre::SceneNode* chFarNode_;
99
100            float timeToReload_;
101            float reloadTime_;
102
103            float maxSideAndBackSpeed_;
104            float maxSpeed_;
105            float maxRotation_;
106            float translationAcceleration_;
107            float rotationAcceleration_;
108            float translationDamping_;
109            float rotationDamping_;
110
111            Radian maxRotationRadian_;
112            Radian rotationAccelerationRadian_;
113            Radian rotationDampingRadian_;
114            Radian zeroRadian_;
115            Radian mouseXRotation_;
116            Radian mouseYRotation_;
117
118            float mouseX_;
119            float mouseY_;
120
121            float emitterRate_;
122    };
123}
124
125#endif /* _SpaceShip_H__ */
Note: See TracBrowser for help on using the repository browser.