Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/camera/src/orxonox/objects/SpaceShip.h @ 1499

Last change on this file since 1499 was 1201, checked in by bknecht, 17 years ago

CameraHandler and Camera work now

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            static SpaceShip* instance_s;
76
77            Vector3 testvector_;
78            bool bInvertYAxis_;
79            bool setMouseEventCallback_;
80            bool bLMousePressed_;
81            bool bRMousePressed_;
82
83            Ogre::SceneNode* camNode_;
84            Camera* cam_;
85
86            ParticleInterface* tt_;
87
88            BillboardSet redBillboard_;
89            BillboardSet greenBillboard_;
90            Ogre::SceneNode* redNode_;
91            Ogre::SceneNode* greenNode_;
92            float blinkTime_;
93
94            BillboardSet crosshairNear_;
95            BillboardSet crosshairFar_;
96            Ogre::SceneNode* chNearNode_;
97            Ogre::SceneNode* chFarNode_;
98
99            float timeToReload_;
100            float reloadTime_;
101
102            float maxSideAndBackSpeed_;
103            float maxSpeed_;
104            float maxRotation_;
105            float translationAcceleration_;
106            float rotationAcceleration_;
107            float translationDamping_;
108            float rotationDamping_;
109
110            Radian maxRotationRadian_;
111            Radian rotationAccelerationRadian_;
112            Radian rotationDampingRadian_;
113            Radian zeroRadian_;
114            Radian mouseXRotation_;
115            Radian mouseYRotation_;
116
117            float mouseX_;
118            float mouseY_;
119
120            float emitterRate_;
121    };
122}
123
124#endif /* _SpaceShip_H__ */
Note: See TracBrowser for help on using the repository browser.