| [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: |
|---|
| 25 | * ... |
|---|
| 26 | * |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| [608] | 29 | #ifndef _SpaceShip_H__ |
|---|
| 30 | #define _SpaceShip_H__ |
|---|
| 31 | |
|---|
| [1039] | 32 | #include "OrxonoxPrereqs.h" |
|---|
| 33 | |
|---|
| [708] | 34 | #include <OgrePrerequisites.h> |
|---|
| 35 | #include <OIS/OISMouse.h> |
|---|
| [608] | 36 | |
|---|
| 37 | #include "Model.h" |
|---|
| [768] | 38 | #include "../tools/BillboardSet.h" |
|---|
| [633] | 39 | |
|---|
| [608] | 40 | namespace orxonox |
|---|
| 41 | { |
|---|
| [729] | 42 | class _OrxonoxExport SpaceShip : public Model, public OIS::MouseListener |
|---|
| [608] | 43 | { |
|---|
| 44 | public: |
|---|
| 45 | SpaceShip(); |
|---|
| 46 | ~SpaceShip(); |
|---|
| [1021] | 47 | bool create(); |
|---|
| 48 | void registerAllVariables(); |
|---|
| [871] | 49 | void init(); |
|---|
| [697] | 50 | void setConfigValues(); |
|---|
| [608] | 51 | virtual void loadParams(TiXmlElement* xmlElem); |
|---|
| [1052] | 52 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
|---|
| [608] | 53 | virtual void tick(float dt); |
|---|
| [736] | 54 | |
|---|
| [871] | 55 | void setCamera(const std::string& camera = ""); |
|---|
| 56 | void setMaxSpeed(float value); |
|---|
| 57 | void setMaxSideAndBackSpeed(float value); |
|---|
| 58 | void setMaxRotation(float value); |
|---|
| 59 | void setTransAcc(float value); |
|---|
| 60 | void setRotAcc(float value); |
|---|
| 61 | void setTransDamp(float value); |
|---|
| 62 | void setRotDamp(float value); |
|---|
| 63 | |
|---|
| [1052] | 64 | static void setMaxSpeedTest(float value) |
|---|
| 65 | { SpaceShip::instance_s->setMaxSpeed(value); } |
|---|
| 66 | |
|---|
| [608] | 67 | bool mouseMoved(const OIS::MouseEvent &e); |
|---|
| [643] | 68 | bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id); |
|---|
| 69 | bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id); |
|---|
| [608] | 70 | |
|---|
| 71 | |
|---|
| 72 | private: |
|---|
| [1052] | 73 | static SpaceShip* instance_s; |
|---|
| 74 | |
|---|
| [786] | 75 | Vector3 testvector_; |
|---|
| [647] | 76 | bool bInvertYAxis_; |
|---|
| [608] | 77 | bool setMouseEventCallback_; |
|---|
| [644] | 78 | bool bLMousePressed_; |
|---|
| 79 | bool bRMousePressed_; |
|---|
| [608] | 80 | |
|---|
| [644] | 81 | Ogre::SceneNode* camNode_; |
|---|
| 82 | |
|---|
| [708] | 83 | ParticleInterface* tt_; |
|---|
| [608] | 84 | |
|---|
| [633] | 85 | BillboardSet redBillboard_; |
|---|
| 86 | BillboardSet greenBillboard_; |
|---|
| 87 | Ogre::SceneNode* redNode_; |
|---|
| 88 | Ogre::SceneNode* greenNode_; |
|---|
| 89 | float blinkTime_; |
|---|
| 90 | |
|---|
| [661] | 91 | BillboardSet crosshairNear_; |
|---|
| 92 | BillboardSet crosshairFar_; |
|---|
| 93 | Ogre::SceneNode* chNearNode_; |
|---|
| 94 | Ogre::SceneNode* chFarNode_; |
|---|
| 95 | |
|---|
| [643] | 96 | float timeToReload_; |
|---|
| 97 | float reloadTime_; |
|---|
| 98 | |
|---|
| [647] | 99 | float maxSideAndBackSpeed_; |
|---|
| 100 | float maxSpeed_; |
|---|
| 101 | float maxRotation_; |
|---|
| 102 | float translationAcceleration_; |
|---|
| 103 | float rotationAcceleration_; |
|---|
| 104 | float translationDamping_; |
|---|
| 105 | float rotationDamping_; |
|---|
| 106 | |
|---|
| 107 | Radian maxRotationRadian_; |
|---|
| 108 | Radian rotationAccelerationRadian_; |
|---|
| 109 | Radian rotationDampingRadian_; |
|---|
| 110 | Radian zeroRadian_; |
|---|
| 111 | Radian mouseXRotation_; |
|---|
| 112 | Radian mouseYRotation_; |
|---|
| 113 | |
|---|
| 114 | float mouseX_; |
|---|
| 115 | float mouseY_; |
|---|
| 116 | |
|---|
| [1037] | 117 | float emitterRate_; |
|---|
| [608] | 118 | }; |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| [673] | 121 | #endif /* _SpaceShip_H__ */ |
|---|