| [10050] | 1 | /* | 
|---|
 | 2 |  *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
 | 3 |  *                    > www.orxonox.net < | 
|---|
 | 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 |  | 
|---|
 | 29 | /** | 
|---|
 | 30 |     @file JumpFigure.h | 
|---|
 | 31 |     @brief Declaration of the JumpFigure class. | 
|---|
 | 32 |     @ingroup Jump | 
|---|
 | 33 | */ | 
|---|
 | 34 |  | 
|---|
 | 35 | #ifndef _JumpFigure_H__ | 
|---|
 | 36 | #define _JumpFigure_H__ | 
|---|
 | 37 |  | 
|---|
 | 38 | #include "jump/JumpPrereqs.h" | 
|---|
 | 39 |  | 
|---|
 | 40 | #include "worldentities/ControllableEntity.h" | 
|---|
 | 41 |  | 
|---|
 | 42 | namespace orxonox | 
|---|
 | 43 | { | 
|---|
 | 44 |  | 
|---|
 | 45 |     /** | 
|---|
 | 46 |     @brief | 
|---|
 | 47 |         The JumpFigure class manages the bats for @ref orxonox::Jump "Jump", which are the elements controlled by the players. | 
|---|
 | 48 |  | 
|---|
 | 49 |         It is responsible for the movement (controlled by the players) of the bat. | 
|---|
 | 50 |  | 
|---|
 | 51 |     @author | 
|---|
 | 52 |         Fabian 'x3n' Landau | 
|---|
 | 53 |  | 
|---|
 | 54 |     @ingroup Jump | 
|---|
 | 55 |     */ | 
|---|
 | 56 |     class _JumpExport JumpFigure : public ControllableEntity | 
|---|
 | 57 |     { | 
|---|
 | 58 |         public: | 
|---|
 | 59 |             JumpFigure(Context* context); //!< Constructor. Registers and initializes the object. | 
|---|
 | 60 |             virtual ~JumpFigure() {} | 
|---|
 | 61 |  | 
|---|
 | 62 |             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); | 
|---|
 | 63 |  | 
|---|
 | 64 |             virtual void tick(float dt); | 
|---|
 | 65 |  | 
|---|
 | 66 |             virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down. | 
|---|
 | 67 |             virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down. | 
|---|
 | 68 |  | 
|---|
 | 69 |             virtual void rotateYaw(const Vector2& value); | 
|---|
 | 70 |             virtual void rotatePitch(const Vector2& value); | 
|---|
 | 71 |             virtual void rotateRoll(const Vector2& value); | 
|---|
 | 72 |  | 
|---|
| [10074] | 73 |             void fire(unsigned int firemode); | 
|---|
| [10050] | 74 |             virtual void fired(unsigned int firemode); | 
|---|
 | 75 |  | 
|---|
 | 76 |             virtual void JumpFromPlatform(JumpPlatform* platform); | 
|---|
| [10074] | 77 |             virtual void JumpFromSpring(JumpSpring* spring); | 
|---|
 | 78 |             virtual void CollisionWithEnemy(JumpEnemy* enemy); | 
|---|
 | 79 |             virtual bool StartRocket(JumpRocket* rocket); | 
|---|
 | 80 |             virtual void StopRocket(JumpRocket* rocket); | 
|---|
 | 81 |             virtual bool StartPropeller(JumpPropeller* propeller); | 
|---|
 | 82 |             virtual void StopPropeller(JumpPropeller* propeller); | 
|---|
 | 83 |             virtual bool StartBoots(JumpBoots* boots); | 
|---|
 | 84 |             virtual void StopBoots(JumpBoots* boots); | 
|---|
 | 85 |             virtual bool StartShield(JumpShield* shield); | 
|---|
 | 86 |             virtual void StopShield(JumpShield* shield); | 
|---|
| [10050] | 87 |  | 
|---|
| [10074] | 88 |             virtual void InitializeAnimation(Context* context); | 
|---|
 | 89 |  | 
|---|
| [10050] | 90 |             void setFieldDimension(float width, float height) | 
|---|
| [10074] | 91 |                 { fieldWidth_ = width; fieldHeight_ = height; } | 
|---|
| [10050] | 92 |  | 
|---|
 | 93 |             void setFieldDimension(const Vector2& dimension) | 
|---|
| [10074] | 94 |                 { setFieldDimension(dimension.x, dimension.y); } | 
|---|
| [10050] | 95 |  | 
|---|
| [10074] | 96 |             Vector2 getFieldDimension() const | 
|---|
 | 97 |                 { return Vector2(fieldWidth_, fieldHeight_); } | 
|---|
 | 98 |  | 
|---|
| [10050] | 99 |             void setMouseFactor(const float mouseFactor) | 
|---|
| [10074] | 100 |                 { mouseFactor_ = mouseFactor; } | 
|---|
| [10050] | 101 |  | 
|---|
 | 102 |             const float getMouseFactor() const | 
|---|
| [10074] | 103 |                 { return mouseFactor_; } | 
|---|
| [10050] | 104 |  | 
|---|
| [10074] | 105 |             void setModelLeftHand(const std::string& modelLeftHand) | 
|---|
 | 106 |                 { modelLeftHand_ = modelLeftHand; } | 
|---|
| [10050] | 107 |  | 
|---|
| [10074] | 108 |             const std::string& getModelLeftHand() const | 
|---|
 | 109 |                 { return modelLeftHand_; } | 
|---|
| [10050] | 110 |  | 
|---|
| [10074] | 111 |             void setModelRightHand(const std::string& modelRightHand) | 
|---|
 | 112 |                 { modelRightHand_ = modelRightHand; } | 
|---|
 | 113 |  | 
|---|
 | 114 |             const std::string& getModelRightHand() const | 
|---|
 | 115 |                 { return modelRightHand_; } | 
|---|
 | 116 |  | 
|---|
 | 117 |             void setRocketPos(const float rocketPos) | 
|---|
 | 118 |                 { rocketPos_ = rocketPos; } | 
|---|
 | 119 |  | 
|---|
 | 120 |             const float getRocketPos() const | 
|---|
 | 121 |                 { return rocketPos_; } | 
|---|
 | 122 |  | 
|---|
 | 123 |                         void setPropellerPos(const float propellerPos) | 
|---|
 | 124 |                                 { propellerPos_ = propellerPos; } | 
|---|
 | 125 |  | 
|---|
 | 126 |                         const float getPropellerPos() const | 
|---|
 | 127 |                                 { return propellerPos_; } | 
|---|
 | 128 |  | 
|---|
 | 129 |                         void setBootsPos(const float bootsPos) | 
|---|
 | 130 |                                 { bootsPos_ = bootsPos; } | 
|---|
 | 131 |  | 
|---|
 | 132 |                         const float getBootsPos() const | 
|---|
 | 133 |                                 { return bootsPos_; } | 
|---|
 | 134 |  | 
|---|
 | 135 |             void setJumpSpeed(const float jumpSpeed) | 
|---|
 | 136 |                 { jumpSpeed_ = jumpSpeed; } | 
|---|
 | 137 |  | 
|---|
 | 138 |             const float getJumpSpeed() const | 
|---|
 | 139 |                 { return jumpSpeed_; } | 
|---|
 | 140 |  | 
|---|
 | 141 |             void setRocketSpeed(const float rocketSpeed) | 
|---|
 | 142 |                 { rocketSpeed_ = rocketSpeed; } | 
|---|
 | 143 |  | 
|---|
 | 144 |             const float getRocketSpeed() const | 
|---|
 | 145 |                 { return rocketSpeed_; } | 
|---|
 | 146 |  | 
|---|
 | 147 |             void setPropellerSpeed(const float propellerSpeed) | 
|---|
 | 148 |                 { propellerSpeed_ = propellerSpeed; } | 
|---|
 | 149 |  | 
|---|
 | 150 |             const float getPropellerSpeed() const | 
|---|
 | 151 |                 { return propellerSpeed_; } | 
|---|
 | 152 |  | 
|---|
 | 153 |             void setHandMinAngle(const float handMinAngle) | 
|---|
 | 154 |                 { handMinAngle_ = handMinAngle; } | 
|---|
 | 155 |  | 
|---|
 | 156 |             const float getHandMinAngle() const | 
|---|
 | 157 |                 { return handMinAngle_; } | 
|---|
 | 158 |  | 
|---|
 | 159 |             void setHandMaxAngle(const float handMaxAngle) | 
|---|
 | 160 |                 { handMaxAngle_ = handMaxAngle; } | 
|---|
 | 161 |  | 
|---|
 | 162 |             const float getHandMaxAngle() const | 
|---|
 | 163 |                 { return handMaxAngle_; } | 
|---|
 | 164 |  | 
|---|
 | 165 |             void setHandSpeed(const float handSpeed) | 
|---|
 | 166 |                 { handSpeed_ = handSpeed; } | 
|---|
 | 167 |  | 
|---|
 | 168 |             const float getHandSpeed() const | 
|---|
 | 169 |                 { return handSpeed_; } | 
|---|
 | 170 |  | 
|---|
| [10050] | 171 |             bool fireSignal; | 
|---|
| [10074] | 172 |             bool dead_; | 
|---|
 | 173 |  | 
|---|
| [10050] | 174 |         private: | 
|---|
| [10074] | 175 |             std::string modelLeftHand_; | 
|---|
 | 176 |             std::string modelRightHand_; | 
|---|
 | 177 |  | 
|---|
 | 178 |             Model* leftHand_; | 
|---|
 | 179 |             Model* rightHand_; | 
|---|
 | 180 |  | 
|---|
 | 181 |             float fieldWidth_; | 
|---|
| [10050] | 182 |             float fieldHeight_; | 
|---|
 | 183 |             float timeSinceLastFire; | 
|---|
 | 184 |  | 
|---|
 | 185 |             bool moveUpPressed; | 
|---|
 | 186 |             bool moveDownPressed; | 
|---|
 | 187 |             bool moveLeftPressed; | 
|---|
 | 188 |             bool moveRightPressed; | 
|---|
 | 189 |             bool firePressed; | 
|---|
 | 190 |  | 
|---|
 | 191 |             float gravityAcceleration; | 
|---|
 | 192 |             float mouseFactor_; | 
|---|
| [10074] | 193 |  | 
|---|
 | 194 |             float jumpSpeed_; | 
|---|
 | 195 |             float handSpeed_; | 
|---|
 | 196 |             float handMaxAngle_; | 
|---|
 | 197 |             float handMinAngle_; | 
|---|
 | 198 |             float rocketPos_; | 
|---|
 | 199 |             float propellerPos_; | 
|---|
 | 200 |             float bootsPos_; | 
|---|
| [10050] | 201 |             float maxFireRate; | 
|---|
 | 202 |  | 
|---|
 | 203 |             float horizontalSpeed; | 
|---|
| [10074] | 204 |  | 
|---|
 | 205 |             float handAngle_; | 
|---|
 | 206 |             bool animateHands_; | 
|---|
 | 207 |             bool turnUp_; | 
|---|
 | 208 |  | 
|---|
 | 209 |             bool rocketActive_; | 
|---|
 | 210 |             bool propellerActive_; | 
|---|
 | 211 |             bool bootsActive_; | 
|---|
 | 212 |             bool shieldActive_; | 
|---|
 | 213 |             float rocketSpeed_; | 
|---|
 | 214 |             float propellerSpeed_; | 
|---|
| [10050] | 215 |     }; | 
|---|
 | 216 | } | 
|---|
 | 217 |  | 
|---|
 | 218 | #endif /* _JumpFigure_H__ */ | 
|---|