[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: |
---|
[1264] | 25 | * Benjamin Knecht |
---|
[1039] | 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
[608] | 29 | #ifndef _SpaceShip_H__ |
---|
| 30 | #define _SpaceShip_H__ |
---|
| 31 | |
---|
[1039] | 32 | #include "OrxonoxPrereqs.h" |
---|
| 33 | |
---|
[708] | 34 | #include <OgrePrerequisites.h> |
---|
[608] | 35 | |
---|
[1272] | 36 | #include "core/InputInterfaces.h" |
---|
[1264] | 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: |
---|
| 46 | SpaceShip(); |
---|
| 47 | ~SpaceShip(); |
---|
[1021] | 48 | bool create(); |
---|
| 49 | void registerAllVariables(); |
---|
[871] | 50 | void init(); |
---|
[697] | 51 | void setConfigValues(); |
---|
[608] | 52 | virtual void loadParams(TiXmlElement* xmlElem); |
---|
[1052] | 53 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
[608] | 54 | virtual void tick(float dt); |
---|
[736] | 55 | |
---|
[871] | 56 | void setCamera(const std::string& camera = ""); |
---|
| 57 | void setMaxSpeed(float value); |
---|
| 58 | void setMaxSideAndBackSpeed(float value); |
---|
| 59 | void setMaxRotation(float value); |
---|
| 60 | void setTransAcc(float value); |
---|
| 61 | void setRotAcc(float value); |
---|
| 62 | void setTransDamp(float value); |
---|
| 63 | void setRotDamp(float value); |
---|
| 64 | |
---|
[1264] | 65 | void getFocus(); |
---|
| 66 | |
---|
[1052] | 67 | static void setMaxSpeedTest(float value) |
---|
| 68 | { SpaceShip::instance_s->setMaxSpeed(value); } |
---|
| 69 | |
---|
[1272] | 70 | bool mouseButtonPressed (const MouseState& state, MouseButton::Enum id); |
---|
| 71 | bool mouseButtonReleased(const MouseState& state, MouseButton::Enum id); |
---|
| 72 | bool mouseButtonHeld (const MouseState& state, MouseButton::Enum id) { return true; } |
---|
| 73 | bool mouseMoved (const MouseState& state); |
---|
| 74 | bool mouseScrolled (const MouseState& state) { return true; } |
---|
[608] | 75 | |
---|
| 76 | |
---|
| 77 | private: |
---|
[1264] | 78 | void createCamera(); |
---|
[1052] | 79 | static SpaceShip* instance_s; |
---|
| 80 | |
---|
[786] | 81 | Vector3 testvector_; |
---|
[647] | 82 | bool bInvertYAxis_; |
---|
[608] | 83 | bool setMouseEventCallback_; |
---|
[644] | 84 | bool bLMousePressed_; |
---|
| 85 | bool bRMousePressed_; |
---|
[608] | 86 | |
---|
[644] | 87 | Ogre::SceneNode* camNode_; |
---|
[1264] | 88 | Camera* cam_; |
---|
| 89 | std::string camName_; |
---|
[644] | 90 | |
---|
[1264] | 91 | |
---|
[708] | 92 | ParticleInterface* tt_; |
---|
[608] | 93 | |
---|
[633] | 94 | BillboardSet redBillboard_; |
---|
| 95 | BillboardSet greenBillboard_; |
---|
| 96 | Ogre::SceneNode* redNode_; |
---|
| 97 | Ogre::SceneNode* greenNode_; |
---|
| 98 | float blinkTime_; |
---|
| 99 | |
---|
[661] | 100 | BillboardSet crosshairNear_; |
---|
| 101 | BillboardSet crosshairFar_; |
---|
| 102 | Ogre::SceneNode* chNearNode_; |
---|
| 103 | Ogre::SceneNode* chFarNode_; |
---|
| 104 | |
---|
[643] | 105 | float timeToReload_; |
---|
| 106 | float reloadTime_; |
---|
| 107 | |
---|
[647] | 108 | float maxSideAndBackSpeed_; |
---|
| 109 | float maxSpeed_; |
---|
| 110 | float maxRotation_; |
---|
| 111 | float translationAcceleration_; |
---|
| 112 | float rotationAcceleration_; |
---|
| 113 | float translationDamping_; |
---|
| 114 | float rotationDamping_; |
---|
| 115 | |
---|
| 116 | Radian maxRotationRadian_; |
---|
| 117 | Radian rotationAccelerationRadian_; |
---|
| 118 | Radian rotationDampingRadian_; |
---|
| 119 | Radian zeroRadian_; |
---|
| 120 | Radian mouseXRotation_; |
---|
| 121 | Radian mouseYRotation_; |
---|
| 122 | |
---|
| 123 | float mouseX_; |
---|
| 124 | float mouseY_; |
---|
| 125 | |
---|
[1037] | 126 | float emitterRate_; |
---|
[1264] | 127 | bool server_; |
---|
[608] | 128 | }; |
---|
| 129 | } |
---|
| 130 | |
---|
[673] | 131 | #endif /* _SpaceShip_H__ */ |
---|