[1039] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * |
---|
| 4 | * |
---|
| 5 | * License notice: |
---|
| 6 | * |
---|
| 7 | * This program is free software; you can redistribute it and/or |
---|
| 8 | * modify it under the terms of the GNU General Public License |
---|
| 9 | * as published by the Free Software Foundation; either version 2 |
---|
| 10 | * of the License, or (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | * GNU General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU General Public License |
---|
| 18 | * along with this program; if not, write to the Free Software |
---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 20 | * |
---|
| 21 | * Author: |
---|
| 22 | * Fabian 'x3n' Landau |
---|
| 23 | * Co-authors: |
---|
| 24 | * ... |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
[608] | 28 | #ifndef _SpaceShip_H__ |
---|
| 29 | #define _SpaceShip_H__ |
---|
| 30 | |
---|
[1039] | 31 | #include "OrxonoxPrereqs.h" |
---|
| 32 | |
---|
[708] | 33 | #include <OgrePrerequisites.h> |
---|
| 34 | #include <OIS/OISMouse.h> |
---|
[608] | 35 | |
---|
| 36 | #include "Model.h" |
---|
[768] | 37 | #include "../tools/BillboardSet.h" |
---|
[633] | 38 | |
---|
[608] | 39 | namespace orxonox |
---|
| 40 | { |
---|
[729] | 41 | class _OrxonoxExport SpaceShip : public Model, public OIS::MouseListener |
---|
[608] | 42 | { |
---|
| 43 | public: |
---|
| 44 | SpaceShip(); |
---|
| 45 | ~SpaceShip(); |
---|
[1021] | 46 | bool create(); |
---|
| 47 | void registerAllVariables(); |
---|
[871] | 48 | void init(); |
---|
[697] | 49 | void setConfigValues(); |
---|
[608] | 50 | virtual void loadParams(TiXmlElement* xmlElem); |
---|
[1052] | 51 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
[608] | 52 | virtual void tick(float dt); |
---|
[736] | 53 | |
---|
[871] | 54 | void setCamera(const std::string& camera = ""); |
---|
| 55 | void setMaxSpeed(float value); |
---|
| 56 | void setMaxSideAndBackSpeed(float value); |
---|
| 57 | void setMaxRotation(float value); |
---|
| 58 | void setTransAcc(float value); |
---|
| 59 | void setRotAcc(float value); |
---|
| 60 | void setTransDamp(float value); |
---|
| 61 | void setRotDamp(float value); |
---|
| 62 | |
---|
[1052] | 63 | static void setMaxSpeedTest(float value) |
---|
| 64 | { SpaceShip::instance_s->setMaxSpeed(value); } |
---|
| 65 | |
---|
[608] | 66 | bool mouseMoved(const OIS::MouseEvent &e); |
---|
[643] | 67 | bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id); |
---|
| 68 | bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id); |
---|
[608] | 69 | |
---|
| 70 | |
---|
| 71 | private: |
---|
[1052] | 72 | static SpaceShip* instance_s; |
---|
| 73 | |
---|
[786] | 74 | Vector3 testvector_; |
---|
[647] | 75 | bool bInvertYAxis_; |
---|
[608] | 76 | bool setMouseEventCallback_; |
---|
[644] | 77 | bool bLMousePressed_; |
---|
| 78 | bool bRMousePressed_; |
---|
[608] | 79 | |
---|
[644] | 80 | Ogre::SceneNode* camNode_; |
---|
| 81 | |
---|
[708] | 82 | ParticleInterface* tt_; |
---|
[608] | 83 | |
---|
[633] | 84 | BillboardSet redBillboard_; |
---|
| 85 | BillboardSet greenBillboard_; |
---|
| 86 | Ogre::SceneNode* redNode_; |
---|
| 87 | Ogre::SceneNode* greenNode_; |
---|
| 88 | float blinkTime_; |
---|
| 89 | |
---|
[661] | 90 | BillboardSet crosshairNear_; |
---|
| 91 | BillboardSet crosshairFar_; |
---|
| 92 | Ogre::SceneNode* chNearNode_; |
---|
| 93 | Ogre::SceneNode* chFarNode_; |
---|
| 94 | |
---|
[643] | 95 | float timeToReload_; |
---|
| 96 | float reloadTime_; |
---|
| 97 | |
---|
[647] | 98 | float maxSideAndBackSpeed_; |
---|
| 99 | float maxSpeed_; |
---|
| 100 | float maxRotation_; |
---|
| 101 | float translationAcceleration_; |
---|
| 102 | float rotationAcceleration_; |
---|
| 103 | float translationDamping_; |
---|
| 104 | float rotationDamping_; |
---|
| 105 | |
---|
| 106 | Radian maxRotationRadian_; |
---|
| 107 | Radian rotationAccelerationRadian_; |
---|
| 108 | Radian rotationDampingRadian_; |
---|
| 109 | Radian zeroRadian_; |
---|
| 110 | Radian mouseXRotation_; |
---|
| 111 | Radian mouseYRotation_; |
---|
| 112 | |
---|
| 113 | float mouseX_; |
---|
| 114 | float mouseY_; |
---|
| 115 | |
---|
[1037] | 116 | float emitterRate_; |
---|
[608] | 117 | }; |
---|
| 118 | } |
---|
| 119 | |
---|
[673] | 120 | #endif /* _SpaceShip_H__ */ |
---|