- Timestamp:
- Feb 19, 2018, 10:32:12 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_HS17_merge/src/orxonox/worldentities/Arrow.h
r11774 r11777 21 21 * 22 22 * Author: 23 * Oli Scheuss23 * jostoffe 24 24 * Co-authors: 25 * Damian 'Mozork' Frick25 * ... 26 26 * 27 27 */ … … 33 33 34 34 #include "core/XMLPort.h" 35 //#include "controllers/ArrowController.h"36 35 37 36 #include "ControllableEntity.h" 38 #include "WorldEntity.h"39 37 40 38 namespace orxonox { 41 39 42 /**43 @brief44 Drone, that is made to move upon a specified pattern.45 This class was constructed for the PPS tutorial.46 @author47 Oli Scheuss48 */49 40 class _OrxonoxExport Arrow : public ControllableEntity 50 41 { 51 42 public: 52 43 Arrow(Context* context); 53 virtual ~Arrow(); 54 55 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an Arrow through XML. 56 virtual void tick(float dt); //!< Defines which actions the Arrow has to take in each tick. 57 58 virtual void moveFrontBack(const Vector2& value); 59 virtual void moveRightLeft(const Vector2& value); 60 virtual void moveUpDown(const Vector2& value); 61 62 virtual void rotateYaw(const Vector2& value); 63 virtual void rotatePitch(const Vector2& value); 64 virtual void rotateRoll(const Vector2& value); 65 66 /** 67 @brief Moves the Drone in the Front/Back-direction by the specifed amount. 68 @param value The amount by which the drone is to be moved. 69 */ 70 inline void moveFrontBack(float value) 71 { this->moveFrontBack(Vector2(value, 0)); } 72 /** 73 @brief Moves the Drone in the Right/Left-direction by the specifed amount. 74 @param value The amount by which the drone is to be moved. 75 */ 76 inline void moveRightLeft(float value) 77 { this->moveRightLeft(Vector2(value, 0)); } 78 /** 79 @brief Moves the Drone in the Up/Down-direction by the specifed amount. 80 @param value The amount by which the drone is to be moved. 81 */ 82 inline void moveUpDown(float value) 83 { this->moveUpDown(Vector2(value, 0)); } 84 85 /** 86 @brief Rotates the Drone around the y-axis by the specifed amount. 87 @param value The amount by which the drone is to be rotated. 88 */ 89 inline void rotateYaw(float value) 90 { this->rotateYaw(Vector2(value, 0)); } 91 /** 92 @brief Rotates the Drone around the x-axis by the specifed amount. 93 @param value The amount by which the drone is to be rotated. 94 */ 95 inline void rotatePitch(float value) 96 { this->rotatePitch(Vector2(value, 0)); } 97 /** 98 @brief Rotates the Drone around the z-axis by the specifed amount. 99 @param value The amount by which the drone is to be rotated. 100 */ 101 inline void rotateRoll(float value) 102 { this->rotateRoll(Vector2(value, 0)); } 103 104 /** 105 @brief Sets the primary thrust to the input amount. 106 @param thrust The amount of thrust. 107 */ 108 inline void setPrimaryThrust( float thrust ) 109 { this->primaryThrust_ = thrust; } 110 //TODO: Place your set-functions here. 111 112 inline void setAuxiliaryThrust ( float thrust ) 113 { this -> auxiliaryThrust_ = thrust; } 114 115 inline void setRotationThrust (float thrust) 116 { this -> rotationThrust_ = thrust;} 117 // Hint: auxiliary thrust, rotation thrust. 118 119 /** 120 @brief Gets the primary thrust to the input amount. 121 @return The amount of thrust. 122 */ 123 inline float getPrimaryThrust() 124 { return this->primaryThrust_; } 125 126 inline float getAuxiliaryThrust() 127 { return this->auxiliaryThrust_;} 128 129 inline float getRotationThrust() 130 { return this->rotationThrust_;} 131 132 //TODO: Place your get-functions here. 133 134 private: 135 //ArrowController *myController_; //!< The controller of the Arrow. 136 137 btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Arrow the next tick. 138 btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Arrow the next tick. 139 float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward. 140 float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations). 141 float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s 142 44 virtual ~Arrow() = default; 143 45 }; 144 46
Note: See TracChangeset
for help on using the changeset viewer.