1 | #ifndef _SpaceShip_H__ |
---|
2 | #define _SpaceShip_H__ |
---|
3 | |
---|
4 | #include <OgrePrerequisites.h> |
---|
5 | #include <OIS/OISMouse.h> |
---|
6 | |
---|
7 | #include "../OrxonoxPrereqs.h" |
---|
8 | |
---|
9 | #include "Model.h" |
---|
10 | #include "../tools/BillboardSet.h" |
---|
11 | |
---|
12 | class TiXmlElement; // Forward declaration |
---|
13 | |
---|
14 | namespace orxonox |
---|
15 | { |
---|
16 | class ParticleInterface; // Forward declaration |
---|
17 | |
---|
18 | class _OrxonoxExport SpaceShip : public Model, public OIS::MouseListener |
---|
19 | { |
---|
20 | public: |
---|
21 | SpaceShip(); |
---|
22 | ~SpaceShip(); |
---|
23 | void init(); |
---|
24 | void setConfigValues(); |
---|
25 | virtual void loadParams(TiXmlElement* xmlElem); |
---|
26 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
27 | virtual void tick(float dt); |
---|
28 | |
---|
29 | void setCamera(const std::string& camera = ""); |
---|
30 | void setMaxSpeed(float value); |
---|
31 | void setMaxSideAndBackSpeed(float value); |
---|
32 | void setMaxRotation(float value); |
---|
33 | void setTransAcc(float value); |
---|
34 | void setRotAcc(float value); |
---|
35 | void setTransDamp(float value); |
---|
36 | void setRotDamp(float value); |
---|
37 | |
---|
38 | static void setMaxSpeedTest(float value) |
---|
39 | { SpaceShip::instance_s->setMaxSpeed(value); } |
---|
40 | |
---|
41 | bool mouseMoved(const OIS::MouseEvent &e); |
---|
42 | bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id); |
---|
43 | bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id); |
---|
44 | |
---|
45 | |
---|
46 | private: |
---|
47 | static SpaceShip* instance_s; |
---|
48 | |
---|
49 | Vector3 testvector_; |
---|
50 | bool bInvertYAxis_; |
---|
51 | bool setMouseEventCallback_; |
---|
52 | bool bLMousePressed_; |
---|
53 | bool bRMousePressed_; |
---|
54 | |
---|
55 | Ogre::SceneNode* camNode_; |
---|
56 | |
---|
57 | ParticleInterface* tt_; |
---|
58 | |
---|
59 | BillboardSet redBillboard_; |
---|
60 | BillboardSet greenBillboard_; |
---|
61 | Ogre::SceneNode* redNode_; |
---|
62 | Ogre::SceneNode* greenNode_; |
---|
63 | float blinkTime_; |
---|
64 | |
---|
65 | BillboardSet crosshairNear_; |
---|
66 | BillboardSet crosshairFar_; |
---|
67 | Ogre::SceneNode* chNearNode_; |
---|
68 | Ogre::SceneNode* chFarNode_; |
---|
69 | |
---|
70 | float timeToReload_; |
---|
71 | float reloadTime_; |
---|
72 | |
---|
73 | float maxSideAndBackSpeed_; |
---|
74 | float maxSpeed_; |
---|
75 | float maxRotation_; |
---|
76 | float translationAcceleration_; |
---|
77 | float rotationAcceleration_; |
---|
78 | float translationDamping_; |
---|
79 | float rotationDamping_; |
---|
80 | |
---|
81 | Radian maxRotationRadian_; |
---|
82 | Radian rotationAccelerationRadian_; |
---|
83 | Radian rotationDampingRadian_; |
---|
84 | Radian zeroRadian_; |
---|
85 | Radian mouseXRotation_; |
---|
86 | Radian mouseYRotation_; |
---|
87 | |
---|
88 | float mouseX_; |
---|
89 | float mouseY_; |
---|
90 | |
---|
91 | int emitterRate_; |
---|
92 | }; |
---|
93 | } |
---|
94 | |
---|
95 | #endif /* _SpaceShip_H__ */ |
---|