| [1039] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
| [1056] | 3 |  *                    > www.orxonox.net < | 
|---|
| [1039] | 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: | 
|---|
| [1293] | 25 |  *      Benjamin Knecht | 
|---|
| [1039] | 26 |  * | 
|---|
 | 27 |  */ | 
|---|
 | 28 |  | 
|---|
| [608] | 29 | #ifndef _SpaceShip_H__ | 
|---|
 | 30 | #define _SpaceShip_H__ | 
|---|
| [1362] | 31 | #include <string> | 
|---|
| [1039] | 32 | #include "OrxonoxPrereqs.h" | 
|---|
| [708] | 33 | #include <OgrePrerequisites.h> | 
|---|
| [1362] | 34 |  | 
|---|
 | 35 | #include "util/Math.h" | 
|---|
| [1293] | 36 | #include "core/InputInterfaces.h" | 
|---|
 | 37 | #include "Camera.h" | 
|---|
| [608] | 38 | #include "Model.h" | 
|---|
| [768] | 39 | #include "../tools/BillboardSet.h" | 
|---|
| [633] | 40 |  | 
|---|
| [608] | 41 | namespace orxonox | 
|---|
 | 42 | { | 
|---|
| [1219] | 43 |     class _OrxonoxExport SpaceShip : public Model, public MouseHandler | 
|---|
| [608] | 44 |     { | 
|---|
 | 45 |         public: | 
|---|
| [1407] | 46 |            | 
|---|
| [1360] | 47 |             static SpaceShip *getLocalShip(); | 
|---|
| [1407] | 48 |              | 
|---|
| [608] | 49 |             SpaceShip(); | 
|---|
 | 50 |             ~SpaceShip(); | 
|---|
| [1021] | 51 |             bool create(); | 
|---|
 | 52 |             void registerAllVariables(); | 
|---|
| [871] | 53 |             void init(); | 
|---|
| [697] | 54 |             void setConfigValues(); | 
|---|
| [1052] | 55 |             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); | 
|---|
| [608] | 56 |             virtual void tick(float dt); | 
|---|
| [736] | 57 |  | 
|---|
| [871] | 58 |             void setCamera(const std::string& camera = ""); | 
|---|
 | 59 |             void setMaxSpeed(float value); | 
|---|
 | 60 |             void setMaxSideAndBackSpeed(float value); | 
|---|
 | 61 |             void setMaxRotation(float value); | 
|---|
 | 62 |             void setTransAcc(float value); | 
|---|
 | 63 |             void setRotAcc(float value); | 
|---|
 | 64 |             void setTransDamp(float value); | 
|---|
 | 65 |             void setRotDamp(float value); | 
|---|
 | 66 |  | 
|---|
| [1407] | 67 |             void getFocus(); | 
|---|
| [1362] | 68 |             static SpaceShip* instance_s; | 
|---|
| [1407] | 69 |             static Vector3 getSPosition(); | 
|---|
 | 70 |             static Quaternion getSOrientation(); | 
|---|
| [1362] | 71 |             static std::string whereAmI(); | 
|---|
| [1052] | 72 |             static void setMaxSpeedTest(float value) | 
|---|
 | 73 |                 { SpaceShip::instance_s->setMaxSpeed(value); } | 
|---|
 | 74 |  | 
|---|
| [1349] | 75 |             void mouseButtonPressed (MouseButton::Enum id); | 
|---|
 | 76 |             void mouseButtonReleased(MouseButton::Enum id); | 
|---|
 | 77 |             void mouseButtonHeld    (MouseButton::Enum id) { } | 
|---|
 | 78 |             void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize); | 
|---|
 | 79 |             void mouseScrolled      (int abs, int rel) { } | 
|---|
| [1362] | 80 |  | 
|---|
| [1407] | 81 |             float getMaxSpeed(); | 
|---|
| [608] | 82 |  | 
|---|
 | 83 |         private: | 
|---|
| [1293] | 84 |             void createCamera(); | 
|---|
| [1052] | 85 |  | 
|---|
| [1407] | 86 |             Vector3 testvector_; | 
|---|
| [647] | 87 |             bool bInvertYAxis_; | 
|---|
| [608] | 88 |             bool setMouseEventCallback_; | 
|---|
| [644] | 89 |             bool bLMousePressed_; | 
|---|
 | 90 |             bool bRMousePressed_; | 
|---|
| [608] | 91 |  | 
|---|
| [644] | 92 |             Ogre::SceneNode* camNode_; | 
|---|
| [1362] | 93 |             Camera* cam_; | 
|---|
| [1293] | 94 |             std::string camName_; | 
|---|
| [644] | 95 |  | 
|---|
| [1293] | 96 |  | 
|---|
| [708] | 97 |             ParticleInterface* tt_; | 
|---|
| [608] | 98 |  | 
|---|
| [633] | 99 |             BillboardSet redBillboard_; | 
|---|
 | 100 |             BillboardSet greenBillboard_; | 
|---|
 | 101 |             Ogre::SceneNode* redNode_; | 
|---|
 | 102 |             Ogre::SceneNode* greenNode_; | 
|---|
 | 103 |             float blinkTime_; | 
|---|
 | 104 |  | 
|---|
| [661] | 105 |             BillboardSet crosshairNear_; | 
|---|
 | 106 |             BillboardSet crosshairFar_; | 
|---|
 | 107 |             Ogre::SceneNode* chNearNode_; | 
|---|
 | 108 |             Ogre::SceneNode* chFarNode_; | 
|---|
 | 109 |  | 
|---|
| [643] | 110 |             float timeToReload_; | 
|---|
 | 111 |             float reloadTime_; | 
|---|
 | 112 |  | 
|---|
| [647] | 113 |             float maxSideAndBackSpeed_; | 
|---|
 | 114 |             float maxSpeed_; | 
|---|
 | 115 |             float maxRotation_; | 
|---|
 | 116 |             float translationAcceleration_; | 
|---|
 | 117 |             float rotationAcceleration_; | 
|---|
 | 118 |             float translationDamping_; | 
|---|
 | 119 |             float rotationDamping_; | 
|---|
 | 120 |  | 
|---|
 | 121 |             Radian maxRotationRadian_; | 
|---|
 | 122 |             Radian rotationAccelerationRadian_; | 
|---|
 | 123 |             Radian rotationDampingRadian_; | 
|---|
 | 124 |             Radian zeroRadian_; | 
|---|
 | 125 |             Radian mouseXRotation_; | 
|---|
 | 126 |             Radian mouseYRotation_; | 
|---|
 | 127 |  | 
|---|
 | 128 |             float mouseX_; | 
|---|
 | 129 |             float mouseY_; | 
|---|
 | 130 |  | 
|---|
| [1037] | 131 |             float emitterRate_; | 
|---|
| [1293] | 132 |             bool server_; | 
|---|
| [608] | 133 |     }; | 
|---|
 | 134 | } | 
|---|
 | 135 |  | 
|---|
| [673] | 136 | #endif /* _SpaceShip_H__ */ | 
|---|